unified

Project: remarkjs/remark-comment-config

Package: remark-comment-config@6.0.0

  1. Dependencies: 0·Dependents: 9
  2. remark plugin to configure it with comments
  1. remark 195
  2. unified 167
  3. markdown 135
  4. plugin 130
  5. mdast 88
  6. remark-plugin 74
  7. comment 7
  8. options 2
  9. config 2
  10. settings 2

remark-comment-config

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to configure it with comments.

Important!

This plugin is affected by the new parser in remark (micromark, see remarkjs/remark#536). Use version 5 while you’re still on remark 12. Use version 6 for remark 13+.

Install

npm:

npm install remark-comment-config

Use

Say we have the following file, example.md:

<!--remark bullet="+"-->

- List item (this is a stringify setting)

And our script, example.js, looks as follows:

var vfile = require('to-vfile')
var remark = require('remark')
var commentConfig = require('remark-comment-config')

remark()
  .use(commentConfig)
  .process(vfile.readSync('example.md'), function (err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

<!--remark bullet="+"-->

+   List item (this is a stringify setting)

API

remark().use(commentConfig)

Plugin to configure remark with comments. Parses comments, such as <!--remark foo="bar" baz-->, and passes the “attributes” as remark-stringify.

This is essentially the same as remark-yaml-config, except that comments are invisible when rendering to HTML (such as on GitHub).

Security

Use of remark-comment-config can change how Markdown is compiled. If the Markdown is user provided, this may open you up to a cross-site scripting (XSS) attack.

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer