{"id":19370060,"url":"https://github.com/bustle/mobiledoc-apple-news-renderer","last_synced_at":"2025-10-04T08:33:07.428Z","repository":{"id":138356488,"uuid":"87123687","full_name":"bustle/mobiledoc-apple-news-renderer","owner":"bustle","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-12T19:47:35.000Z","size":166,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-10-03T16:34:42.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bustle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-03T21:43:13.000Z","updated_at":"2019-04-12T19:47:37.000Z","dependencies_parsed_at":"2023-07-16T20:08:32.029Z","dependency_job_id":null,"html_url":"https://github.com/bustle/mobiledoc-apple-news-renderer","commit_stats":null,"previous_names":["bustlelabs/mobiledoc-apple-news-renderer"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bustle%2Fmobiledoc-apple-news-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bustle%2Fmobiledoc-apple-news-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bustle%2Fmobiledoc-apple-news-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bustle%2Fmobiledoc-apple-news-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bustle","download_url":"https://codeload.github.com/bustle/mobiledoc-apple-news-renderer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240492160,"owners_count":19810042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T08:14:06.398Z","updated_at":"2025-10-04T08:33:02.393Z","avatar_url":"https://github.com/bustle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Mobiledoc Apple News Renderer\n\nRenders mobiledoc to an array of apple news components. Supports mobiledoc\nversion 0.3.0 and later. Supports Apple News format 1.4.\n\n[Apple News Format 1.0\nReference](https://developer.apple.com/library/content/documentation/General/Conceptual/Apple_News_Format_Ref/index.html#//apple_ref/doc/uid/TP40015408-CH102-SW1)\n\nThe mapping in `lib/utils/apple-news` is used to map mobiledoc section tag names\nto Apple News component roles.\n\nThe renderer returns an render result that is a fully-realized (albeit\nunstyled) article.json. The article's components correspond to the rendered\nsections of the mobiledoc.\n\n### Usage\n\nMust pass an `htmlSerializer` property to the renderer, as\nwell as a `dom` property.\n\n`htmlSerializer` is a function that will be called with a DOM (or SimpleDOM) element\nand it will return the serialized HTML as a string.\n\nExample:\n\n```javascript\nimport Renderer from 'mobiledoc-apple-news-renderer';\nimport SimpleDOM from 'simple-dom';\n\nlet renderer = new Renderer(mobiledoc, {\n  cards: [],\n  dom: new SimpleDOM.Document(),\n  htmlSerializer: (element) =\u003e {\n    return new SimpleDOM.HTMLSerializer(SimpleDOM.voidMap).\n             serializeChildren(element);\n  }\n});\n\nlet rendered = renderer.render();\nlet article = rendered.result;\n/*\n   article: {\n     version: '1.0',\n     title: 'Default Title',\n     layout: {},\n     ... other Apple News default properties\n     components: [\n       {\n         role: 'body',\n         format: 'html',\n         text: 'The rendered HTML of the first mobiledoc section...'\n       },\n       ...\n     ]\n   }\n */\n```\n\n### Running tests\n\nIn browser:\n  * `npm start`\n  * visit http://localhost:4200/tests\n\nCI:\n  * `npm test`\n\n### Publishing\n\nBefore publishing run `npm run build` to generate the transpiled files in\n`dist/`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbustle%2Fmobiledoc-apple-news-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbustle%2Fmobiledoc-apple-news-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbustle%2Fmobiledoc-apple-news-renderer/lists"}