{"id":20947733,"url":"https://github.com/alphahydrae/md2remark","last_synced_at":"2025-05-14T02:30:28.485Z","repository":{"id":17440876,"uuid":"81256326","full_name":"AlphaHydrae/md2remark","owner":"AlphaHydrae","description":"Convert regular Markdown to Remark slides, with a few extensions","archived":false,"fork":false,"pushed_at":"2023-01-09T06:24:52.000Z","size":864,"stargazers_count":4,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T15:59:40.533Z","etag":null,"topics":["markdown","remarkjs","slides"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlphaHydrae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-07T21:30:39.000Z","updated_at":"2022-09-09T17:53:38.000Z","dependencies_parsed_at":"2023-01-13T19:20:05.421Z","dependency_job_id":null,"html_url":"https://github.com/AlphaHydrae/md2remark","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fmd2remark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fmd2remark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fmd2remark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlphaHydrae%2Fmd2remark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlphaHydrae","download_url":"https://codeload.github.com/AlphaHydrae/md2remark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225270612,"owners_count":17447635,"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":["markdown","remarkjs","slides"],"created_at":"2024-11-19T00:12:49.652Z","updated_at":"2024-11-19T00:12:50.136Z","avatar_url":"https://github.com/AlphaHydrae.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# md2remark\n\n[![npm version](https://badge.fury.io/js/md2remark.svg)](https://badge.fury.io/js/md2remark)\n[![Build Status](https://travis-ci.org/AlphaHydrae/md2remark.svg?branch=master)](https://travis-ci.org/AlphaHydrae/md2remark)\n[![Coverage Status](https://coveralls.io/repos/github/AlphaHydrae/md2remark/badge.svg?branch=master)](https://coveralls.io/github/AlphaHydrae/md2remark?branch=master)\n\n\u003e Convert regular Markdown to [Remark][remark] slides, with a few extensions.\n\nThe problem this project tries to solve is that [Remark][remark] forces you to\nwrite non-standard Markdown that doesn't render very well on GitHub, for\nexample:\n\n* `???` for slide notes\n* `---` to separate slides\n* `class: center, middle` front matter at the beginning of slides\n\nThe `md2remark` utility takes regular Markdown with special HTML comments, and\nconverts these comments to Remark-compatible annotations. That way, your\nMarkdown looks good on GitHub, and can also be easily converted to Remark\nslides.\n\nSee [Usage](#usage) for an example, and [the documentation](#documentation) to\nknow what HTML comments you can write.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Requirements](#requirements)\n- [Usage](#usage)\n- [Documentation](#documentation)\n  - [Start a new slide](#start-a-new-slide)\n  - [Slide front matter](#slide-front-matter)\n  - [Slide notes](#slide-notes)\n  - [Slide columns](#slide-columns)\n    - [Omit column widths](#omit-column-widths)\n  - [Breadcrumbs](#breadcrumbs)\n  - [Includes](#includes)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\n\n\n\n## Requirements\n\n* [Node.js][node] 18+\n\n\n\n\n\n## Usage\n\nInstall it with `npm install --save md2remark`, then use it in your code:\n\n```js\nconst md2remark = require('md2remark');\n\nconst markdown = `\n# Title\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n## Subtitle\n\n* Suspendisse potenti.\n* Proin vel elit eget dolor dignissim gravida.\n\n\u003c!-- slide-notes --\u003e\n\nAmazing slide.\n`;\n\nmd2remark(markdown).then(function(slidesMarkdown) {\n  console.log(slidesMarkdown);\n});\n```\n\nThis will output:\n\n```txt\n# Title\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\n\n---\n## Subtitle\n\n* Suspendisse potenti.\n* Proin vel elit eget dolor dignissim gravida.\n\n???\n\nAmazing slide.\n```\n\n\n\n\n\n## Documentation\n\nThis documentation assumes that you are familiar with the basics of [Remark\nslides][remark]. The full Remark documentation is available [here][remark-docs].\n\n\n\n### Start a new slide\n\nAll Markdown headers in the `#` form are automatically prefixed with `---` to\nstart a new slide, except level 1 headers.\n\nThere's currently no other way to start a new slide with `md2remark` (to be\nimproved).\n\nThe following Markdown:\n\n```md\n# Main title\n\n## Slide 1\n\n### More\n```\n\nWill be converted to:\n\n```md\n---\n# Main title\n\n---\n## Slide 1\n\n---\n### More\n```\n\n\n\n### Slide front matter\n\nAdd a `\u003c!-- slide-front-matter FRONTMATTER --\u003e` comment **after** a Markdown\nheader. The contents of the comment (`FRONTMATTER`) will be prepended to the\nprevious Markdown header.\n\nThe following Markdown:\n\n```md\n## Slide 1\n\n\u003c!-- slide-front-matter class: center, middle --\u003e\n\nLorem ipsum dolor sit amet.\n\n## Slide 2\n\nConsectetur adipiscing elit.\n```\n\nWill be converted to:\n\n```md\n---\nclass: center, middle\n## Slide 1\n\nLorem ipsum dolor sit amet.\n\n---\n## Slide 2\n\nConsectetur adipiscing elit.\n```\n\n\n\n### Slide notes\n\nAdd a `\u003c!-- slide-notes --\u003e` comment in a slide. It will be replaced by the\nRemark notes annotation `???`.\n\nThe following Markdown:\n\n```md\n## Slide\n\nLorem ipsum dolor sit amet.\n\n\u003c!-- slide-notes --\u003e\n\nConsectetur adipiscing elit.\n```\n\nWill be converted to:\n\n```md\n---\n## Slide\n\nLorem ipsum dolor sit amet.\n\n???\n\nConsectetur adipiscing elit.\n```\n\n\n\n### Slide columns\n\nUse a `\u003c!-- slide-column WIDTH --\u003e` comment to define a column. You can only use\none level of columns (they cannot be nested).\n\nIf you want to add content after a column row, close the row with a\n`\u003c!-- slide-container --\u003e` comment.\n\nThis feature requires you to add [unsemantic][unsemantic] to your slides'\nHTML template, as it is based on unsemantic's grid system:\n\n```html\n\u003clink rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/unsemantic/1.1.3/unsemantic-grid-responsive.min.css'\u003e\n```\n\nFor containers to work, you should add the following CSS to your slides' HTML\ntemplate:\n\n```html\n\u003cstyle\u003e\n  .container {\n    clear: both;\n  }\n\u003c/style\u003e\n```\n\nThe following Markdown:\n\n```md\n## Slide\n\nConsectetur adipiscing elit.\n\n\u003c!-- slide-column 40 --\u003e\n\nLorem ipsum dolor sit amet.\n\n\u003c!-- slide-column 60 --\u003e\n\nProin vel elit eget dolor dignissim gravida.\n\n\u003c!-- slide-container --\u003e\n\nSuspendisse potenti.\n```\n\nWill be converted to:\n\n```md\n## Slide\n\nConsectetur adipiscing elit.\n\n.grid-40[\n\nLorem ipsum dolor sit amet.\n\n]\n.grid-60[\n\nProin vel elit eget dolor dignissim gravida.\n\n]\n.container[\n\nSuspendisse potenti.\n]\n```\n\n#### Omit column widths\n\nYou can also omit column widths or specify it only for one column.\nRemaining columns will be sized automatically based on the remaining space.\n\n*(Note that unsemantic column widths should be multiples of 5 or 33, and that this is NOT checked for you at this time.)*\n\nThe following Markdown:\n\n```md\n\u003c!-- slide-column 40 --\u003e\n\u003c!-- slide-column --\u003e\n\u003c!-- slide-column --\u003e\n\u003c!-- slide-container --\u003e\n\u003c!-- slide-column 66 --\u003e\n\u003c!-- slide-column --\u003e\n\u003c!-- slide-container --\u003e\n\u003c!-- slide-column --\u003e\n\u003c!-- slide-column --\u003e\n```\n\nWill be converted to:\n\n```md\n.grid-40[\n]\n.grid-20[\n]\n.grid-20[\n]\n.container[\n]\n.grid-66[\n]\n.grid-33[\n]\n.container[\n]\n.grid-50[\n]\n.grid-50[\n]\n```\n\n\n\n### Breadcrumbs\n\nIf you set the `breadcrumbs` option to `true`, breadcumbs will be added after each Markdown header,\ncontaining the list of parent Markdown headers:\n\n```js\nmd2remark(markdown, { breadcrumbs: true }).then(callback);\n```\n\nThe following Markdown:\n\n```md\n# Foo\n\n## Bar\n\n### Baz\n\n## Qux\n```\n\nWill be converted to:\n\n```md\n# Foo\n\n## Bar\n\n.breadcrumbs[\u003ca href=\"#1\"\u003eFoo\u003c/a\u003e]\n\n### Baz\n\n.breadcrumbs[\u003ca href=\"#1\"\u003eFoo\u003c/a\u003e \u003e \u003ca href=\"#2\"\u003eBar\u003c/a\u003e]\n\n## Qux\n\n.breadcrumbs[\u003ca href=\"#1\"\u003eFoo\u003c/a\u003e]\n```\n\n\n\n### Includes\n\nUse `\u003c!-- slide-include path/to/file.md --\u003e` to include another Markdown (or plain text) file.\n\nAssuming you have a `HELLO.md` file containing the text \"Hello World!\" in the current working directory, the following Markdown:\n\n```md\n# Foo\n\n\u003c!-- slide-include HELLO.md --\u003e\n```\n\nWill be converted to:\n\n```md\n# Foo\n\nHello World!\n```\n\nIncluded files are inserted without further parsing or transformation (they cannot contain other includes themselves).\n\nBy default, the path is relative to the process's current working directory.\nTo make it relative to the Markdown file making the inclusion, you have to give the file's path when you call `md2remark`:\n\n```js\nconst file = '/path/to/some/markdown.md';\nconst markdown = fs.readFileSync(file, 'utf-8');\n\nmd2remark(markdown, { file: file }).then(function(slidesMarkdown) {\n  console.log(slidesMarkdown);\n});\n```\n\n\n\n\n\n[node]: https://nodejs.org\n[remark]: https://remarkjs.com\n[remark-docs]: https://github.com/gnab/remark/wiki/Markdown\n[unsemantic]: http://unsemantic.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fmd2remark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphahydrae%2Fmd2remark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphahydrae%2Fmd2remark/lists"}