{"name":"remarkable","description":"Markdown parser and lexer.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/remarkable","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/remarkable.git"},"bugs":{"url":"https://github.com/jonschlinkert/remarkable/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/remarkable/blob/master/LICENSE-MIT"}],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"verb":">= 0.2.6","mocha":"*"},"keywords":["markdown"],"_id":"remarkable@0.1.0","_shasum":"cd4fb9bf3ff3d546c17a2d0f9748d8f92c1fa9c1","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"cd4fb9bf3ff3d546c17a2d0f9748d8f92c1fa9c1","tarball":"http://registry-npm.ywwl.com/remarkable/download/remarkable-0.1.0.tgz","integrity":"sha512-RLo6HzBDU2FgSVY0K4KUIXeLVjoHK1v68ku1/1d6G4HNnnnLFUucDP6ajGU+xEHWJYZpsyVrGLNhDY7R145QmA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoaPvQ0jG7i+Gjq00GsaxnRC4CKoY5fdByeVuyZptVJgIhAPhuzGbDUsnIDQbBeSVJY2swU3SBiTNhwn20MilsVRpz"}],"size":2323,"noattachment":false,"key":"/remarkable/-/remarkable-0.1.0.tgz"},"directories":{},"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> 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\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// => <h1>Remarkable rulezz!</h1>\n```\n\nor with commonjs\n\n```js\nconst { Remarkable } = require('remarkable');\nvar md = new Remarkable();\n\nconsole.log(md.render('# Remarkable rulezz!'));\n// => <h1>Remarkable rulezz!</h1>\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 (<br />)\n  breaks:       false,        // Convert '\\n' in paragraphs into <br>\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// => <h1>Remarkable rulezz!</h1>\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 && 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- [\\<del>](https://help.github.com/articles/github-flavored-markdown/#strikethrough)\n  (GFM strikethrough) - `~~deleted text~~`\n\nDisabled by default:\n\n- [\\<sup>](http://johnmacfarlane.net/pandoc/README.html#superscripts-and-subscripts) - `19^th^`\n- [\\<sub>](http://johnmacfarlane.net/pandoc/README.html#superscripts-and-subscripts) - `H~2~O`\n- [abbreviations](https://michelf.ca/projects/php-markdown/extra/#abbr)\n- __\\<ins>__ - `++inserted text++` (experimental)\n- __\\<mark>__ - `==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) -> §\n// ... → … (also ?.... → ?.., !.... → !..)\n// ???????? → ???, !!!!! → !!!, `,,` → `,`\n// -- → &ndash;, --- → &mdash;\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 & JS,\n   also contains latest spec & 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 > spec\n\nSample: spec.txt (110610 bytes)\n > commonmark-reference x 40.42 ops/sec ±4.07% (51 runs sampled)\n > current x 74.99 ops/sec ±4.69% (67 runs sampled)\n > current-commonmark x 93.76 ops/sec ±1.23% (79 runs sampled)\n > 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","publish_time":1409321059579,"_cnpm_publish_time":1409321059579,"dist-tags":{"latest":"2.0.1"}}