{"id":13403620,"url":"https://github.com/jonschlinkert/remarkable","last_synced_at":"2025-05-08T22:27:14.185Z","repository":{"id":20277733,"uuid":"23550956","full_name":"jonschlinkert/remarkable","owner":"jonschlinkert","description":"Markdown parser, done right. Commonmark support, extensions, syntax plugins, high speed - all in one. Gulp and metalsmith plugins available. Used by Facebook, Docusaurus and many others! Use https://github.com/breakdance/breakdance for HTML-to-markdown conversion. Use https://github.com/jonschlinkert/markdown-toc to generate a table of contents.","archived":false,"fork":false,"pushed_at":"2024-05-17T12:20:51.000Z","size":1531,"stargazers_count":5800,"open_issues_count":131,"forks_count":375,"subscribers_count":90,"default_branch":"master","last_synced_at":"2025-05-07T19:44:08.457Z","etag":null,"topics":["commonmark","compile","docusaurus","gfm","javascript","jonschlinkert","markdown","markdown-it","markdown-parser","md","node","nodejs","parse","parser","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://jonschlinkert.github.io/remarkable/demo/","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/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/contributing.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/demodata.js","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["jonschlinkert"]}},"created_at":"2014-09-01T17:57:42.000Z","updated_at":"2025-05-07T01:33:40.000Z","dependencies_parsed_at":"2022-07-17T00:45:59.948Z","dependency_job_id":"f22df313-a78e-472a-8d5a-5caf5c4840b8","html_url":"https://github.com/jonschlinkert/remarkable","commit_stats":{"total_commits":463,"total_committers":43,"mean_commits":"10.767441860465116","dds":0.4319654427645788,"last_synced_commit":"a6a411f90f479ef88961e711c8487f0f56219ab1"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fremarkable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fremarkable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fremarkable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fremarkable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/remarkable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252963071,"owners_count":21832454,"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":["commonmark","compile","docusaurus","gfm","javascript","jonschlinkert","markdown","markdown-it","markdown-parser","md","node","nodejs","parse","parser","syntax-highlighting"],"created_at":"2024-07-30T19:01:32.454Z","updated_at":"2025-05-07T22:23:57.801Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","readme":"# remarkable\n\n[![Build Status](https://travis-ci.org/jonschlinkert/remarkable.svg?branch=master)](https://travis-ci.org/jonschlinkert/remarkable)\n[![NPM version](https://img.shields.io/npm/v/remarkable.svg)](https://www.npmjs.org/package/remarkable)\n[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/remarkable/badge?style=rounded)](https://www.jsdelivr.com/package/npm/remarkable)\n[![Coverage Status](https://img.shields.io/coveralls/jonschlinkert/remarkable.svg)](https://coveralls.io/r/jonschlinkert/remarkable?branch=dev)\n\n\u003e Markdown parser done right. Fast and easy to extend.\n\n__[Live demo](http://jonschlinkert.github.io/remarkable/demo/)__\n\n- Supports the [CommonMark](http://commonmark.org/) spec +\n  [syntax extensions](#syntax-extensions) + sugar (URL autolinking, typographer).\n- Configurable syntax! You can add new rules and even replace existing ones.\n- [High speed](#benchmark)!\n- [Community plugins](https://www.npmjs.org/browse/keyword/remarkable) on npm.\n\n\u003cbr /\u003e\n\n\n## Install\n\n**node.js:**\n\n```bash\nnpm install remarkable --save\n```\n\n**browser (CDN):**\n\n- [jsDeliver CDN](http://www.jsdelivr.com/#!remarkable \"jsDelivr CDN\")\n- [cdnjs](https://cdnjs.com/libraries/remarkable \"cdnjs\")\n\n\n## Usage\n\n```js\nimport { Remarkable } from 'remarkable';\nvar md = new Remarkable();\n\nconsole.log(md.render('# Remarkable rulezz!'));\n// =\u003e \u003ch1\u003eRemarkable rulezz!\u003c/h1\u003e\n```\n\nor with commonjs\n\n```js\nconst { Remarkable } = require('remarkable');\nvar md = new Remarkable();\n\nconsole.log(md.render('# Remarkable rulezz!'));\n// =\u003e \u003ch1\u003eRemarkable rulezz!\u003c/h1\u003e\n```\n\n\nIf installed globally with `npm`:\n\n```sh\ncat myfile.md | remarkable\nremarkable --file myfile.md\n\n# get options\nremarkable -h\n```\n\n## Documentation\n\nSee the [docs](docs/) directory for documentation on the following topics:\n\n- [parser](docs/parser.md)\n- [parsing_block](docs/parsing_block.md)\n- [parsing_core](docs/parsing_core.md)\n- [parsing_inline](docs/parsing_inline.md)\n- [plugins](docs/plugins.md)\n- [renderer](docs/renderer.md)\n\n### Options\n\nBy default, remarkable is configured to be similar to GFM, but with HTML disabled.\nThis is easy to change if you prefer different settings.\n\nThere are two ways to define options.\n\n#### constructor\n\nDefine options in the constructor:\n\n```js\n// Actual default values\nvar md = new Remarkable({\n  html:         false,        // Enable HTML tags in source\n  xhtmlOut:     false,        // Use '/' to close single tags (\u003cbr /\u003e)\n  breaks:       false,        // Convert '\\n' in paragraphs into \u003cbr\u003e\n  langPrefix:   'language-',  // CSS language prefix for fenced blocks\n\n  // Enable some language-neutral replacement + quotes beautification\n  typographer:  false,\n\n  // Double + single quotes replacement pairs, when typographer enabled,\n  // and smartquotes on. Set doubles to '«»' for Russian, '„“' for German.\n  quotes: '“”‘’',\n\n  // Highlighter function. Should return escaped HTML,\n  // or '' if the source string is not changed\n  highlight: function (/*str, lang*/) { return ''; }\n});\n\nconsole.log(md.render('# Remarkable rulezz!'));\n// =\u003e \u003ch1\u003eRemarkable rulezz!\u003c/h1\u003e\n```\n\n#### .set\n\nOr define options via the `.set()` method:\n\n```js\nimport { Remarkable } from 'remarkable';\n\nvar md = new Remarkable();\n\nmd.set({\n  html: true,\n  breaks: true\n});\n```\n\n**Note:** To achieve the best possible performance, don't modify a `Remarkable`\ninstance on the fly. If you need multiple configurations, create\nmultiple instances and initialize each with a configuration that is ideal for\nthat instance.\n\n\n### Presets\n\nRemarkable offers some \"presets\" as a convenience to quickly enable/disable\nactive syntax rules and options for common use cases.\n\n#### commonmark\n\nEnable strict [CommonMark](http://commonmark.org/) mode with the `commonmark` preset:\n\n```js\nimport { Remarkable } from 'remarkable';\nvar md = new Remarkable('commonmark');\n```\n\n#### full\n\nEnable all available rules (but still with default options, if not set):\n\n```js\nimport { Remarkable } from 'remarkable';\nvar md = new Remarkable('full');\n\n// Or with options:\nvar md = new Remarkable('full', {\n  html: true,\n  typographer: true\n});\n```\n\n\n### Syntax highlighting\n\nApply syntax highlighting to fenced code blocks with the `highlight` option:\n\n```js\nimport { Remarkable } from 'remarkable';\nimport hljs from 'highlight.js' // https://highlightjs.org/\n\n// Actual default values\nvar md = new Remarkable({\n  highlight: function (str, lang) {\n    if (lang \u0026\u0026 hljs.getLanguage(lang)) {\n      try {\n        return hljs.highlight(lang, str).value;\n      } catch (err) {}\n    }\n\n    try {\n      return hljs.highlightAuto(str).value;\n    } catch (err) {}\n\n    return ''; // use external default escaping\n  }\n});\n```\n\n\n### Syntax extensions\n\nEnabled by default:\n\n- [Footnotes](http://johnmacfarlane.net/pandoc/README.html#footnotes)\n- [Tables](https://help.github.com/articles/github-flavored-markdown/#tables) (GFM)\n- [\\\u003cdel\u003e](https://help.github.com/articles/github-flavored-markdown/#strikethrough)\n  (GFM strikethrough) - `~~deleted text~~`\n\nDisabled by default:\n\n- [\\\u003csup\u003e](http://johnmacfarlane.net/pandoc/README.html#superscripts-and-subscripts) - `19^th^`\n- [\\\u003csub\u003e](http://johnmacfarlane.net/pandoc/README.html#superscripts-and-subscripts) - `H~2~O`\n- [abbreviations](https://michelf.ca/projects/php-markdown/extra/#abbr)\n- __\\\u003cins\u003e__ - `++inserted text++` (experimental)\n- __\\\u003cmark\u003e__ - `==marked text==` (experimental)\n\n**HEADS UP!**: Experimental extensions can be changed later for something like [Critic Markup](http://criticmarkup.com/), but you will still be able to use old-style rules via external plugins if you prefer.\n\n\n### Manage rules\n\n```js\nvar md = new Remarkable();\nmd.inline.ruler.enable([ 'ins', 'mark' ]);\nmd.block.ruler.disable([ 'table', 'footnote' ]);\n\n// Enable everything\nmd = new Remarkable('full', {\n  html: true,\n  typographer: true,\n});\n\n//\n// Manually enable rules, disabled by default:\n//\nvar md = new Remarkable();\nmd.core.ruler.enable([\n  'abbr'\n]);\nmd.block.ruler.enable([\n  'footnote',\n  'deflist'\n]);\nmd.inline.ruler.enable([\n  'footnote_inline',\n  'ins',\n  'mark',\n  'sub',\n  'sup'\n]);\n```\n\n\n### Typographer\n\nAlthough full-weight typographical replacements are language specific, `remarkable`\nprovides coverage for the most common and universal use cases:\n\n```js\nimport { Remarkable } from 'remarkable';\nvar md = new Remarkable({\n  typographer: true,\n  quotes: '“”‘’'\n});\n\n// Disable rules at all:\nmd.core.ruler.disable([ 'replacements', 'smartquotes' ]);\n\n// Actual default replacements:\n//\n// '' → ‘’\n// \"\" → “”. Set '«»' for Russian, '„“' for German, empty to disable\n// (c) (C) → ©\n// (tm) (TM) → ™\n// (r) (R) → ®\n// +- → ±\n// (p) (P) -\u003e §\n// ... → … (also ?.... → ?.., !.... → !..)\n// ???????? → ???, !!!!! → !!!, `,,` → `,`\n// -- → \u0026ndash;, --- → \u0026mdash;\n//\n```\n\nOf course, you can also add your own rules or replace the defaults with something\nmore advanced or specific to your language.\n\n\n### Plugins\n\nEasily load plugins with the `.use()` method:\n\n```js\nvar md = new Remarkable();\n\nmd.use(plugin1)\n  .use(plugin2, opts)\n  .use(plugin3);\n```\n\nPlease refer to the [plugin documentation](docs/plugins.md) to create your own\nplugins.\n\n### linkify plugin\n\nAutoconvert URL-like text to links\n\n```js\nimport { Remarkable } from 'remarkable';\nimport { linkify } from 'remarkable/linkify';\n\nvar md = new Remarkable().use(linkify);\n```\n\n### UMD\n\nUMD bundle provides linkify out of the box\n\n```js\nconst { Remarkable, linkify, utils } = window.remarkable;\n```\n\n\n## References / Thanks\n\nBig thanks to [John MacFarlane](https://github.com/jgm) for his work on the\nCommonMark spec and reference implementations. His work saved us a lot of time\nduring this project's development.\n\n**Related Links:**\n\n1. https://github.com/jgm/CommonMark - reference CommonMark implementations in C \u0026 JS,\n   also contains latest spec \u0026 online demo.\n2. http://talk.commonmark.org - CommonMark forum, good place to collaborate\n   developers' efforts.\n\n\n## Development / Modification\n\n[Parser](docs/parser.md) consists of several responsibility chains filled with\nrules. You can reconfigure any of them as you wish. [Renderer](docs/renderer.md) also\ncan be modified and extended. See source code to understand details. Pay\nattention to these properties:\n\n```js\nRemarkable.core\nRemarkable.core.ruler\nRemarkable.block\nRemarkable.block.ruler\nRemarkable.inline\nRemarkable.inline.ruler\nRemarkable.renderer\nRemarkable.renderer.rules\n```\n\n## Benchmark\n\nHere is result of CommonMark spec parse at Core i5 2.4 GHz (i5-4258U):\n\n```bash\n$ benchmark/benchmark.js spec\nSelected samples: (1 of 27)\n \u003e spec\n\nSample: spec.txt (110610 bytes)\n \u003e commonmark-reference x 40.42 ops/sec ±4.07% (51 runs sampled)\n \u003e current x 74.99 ops/sec ±4.69% (67 runs sampled)\n \u003e current-commonmark x 93.76 ops/sec ±1.23% (79 runs sampled)\n \u003e marked-0.3.2 x 22.92 ops/sec ±0.79% (41 runs sampled)\n```\n\nAs you can see, `remarkable` doesn't pay with speed for its flexibility. Because\nit's written in monomorphic style and uses JIT inline caches effectively.\n\n\n## Authors\n\n- Jon Schlinkert [github/jonschlinkert](https://github.com/jonschlinkert)\n- Alex Kocharin [github/rlidwka](https://github.com/rlidwka)\n- Vitaly Puzrin [github/puzrin](https://github.com/puzrin)\n\n\n## License\n\n[MIT](https://github.com/jonschlinkert/remarkable/blob/master/LICENSE)\n","funding_links":["https://github.com/sponsors/jonschlinkert"],"categories":["JavaScript","Uncategorized","Javascript and jQuery Libraries","javascript","nodejs","Markdown Tools","目录","Web Development","Markdown Building Blocks"],"sub_categories":["Uncategorized","Angular","Markdown to Table of Contents (TOC)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fremarkable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fremarkable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fremarkable/lists"}