JSPM

  • Created
  • Published
  • Downloads 2133621
  • Score
    100M100P100Q189554F
  • License MIT

Markdown processor powered by plugins

Package Exports

  • remark
  • remark/package.json

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remark) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

remark Travis Coverage Downloads Size Chat

remark is a markdown processor powered by plugins part of the unified collective.

Don’t need the parser? Or the compiler? That’s OK.


Announcing the unified collective! 🎉 Read more about it on Medium »

Sponsors



🥇 ZEIT


🥇 Gatsby


🥉 Compositor


Holloway




You?

Installation

npm:

npm install remark

Usage

Common example

This example lints markdown and turns it into HTML.

var remark = require('remark')
var recommended = require('remark-preset-lint-recommended')
var html = require('remark-html')
var report = require('vfile-reporter')

remark()
  .use(recommended)
  .use(html)
  .process('## Hello world!', function(err, file) {
    console.error(report(err || file))
    console.log(String(file))
  })

Yields:

1:1  warning  Missing newline character at end of file  final-newline  remark-lint

⚠ 1 warning
<h2>Hello world!</h2>
Settings through data

This example prettifies markdown and configures remark-parse and remark-stringify through data.

var remark = require('remark')

remark()
  .data('settings', {commonmark: true, emphasis: '*', strong: '*'})
  .process('_Emphasis_ and __importance__', function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Yields:

*Emphasis* and **importance**
Settings through a preset

This example prettifies markdown and configures remark-parse and remark-stringify through a preset.

var remark = require('remark')

remark()
  .use({
    settings: {commonmark: true, emphasis: '*', strong: '*'}
  })
  .process('_Emphasis_ and __importance__', function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Yields:

*Emphasis* and **importance**

License

MIT © Titus Wormer