npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

remark-comment-config

5.0.3 • Public • Published

remark-comment-config

Build Coverage Downloads Chat Sponsors Backers

Configure remark with comments.

Installation

npm:

npm install remark-comment-config

Usage

Say we have the following file, example.md:

<!--remark commonmark bullet="*"-->
 
1) Commonmark list (this is a parse setting)
 
- 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 commonmark bullet="*"-->
 
1.  Commonmark list (this is a parse setting)
 
*   List item (this is a stringify setting)

API

remark().use(commentConfig)

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

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

Related

Contribute

See contributing.md in remarkjs/remark for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

install

npm i remark-comment-config

Downloadsweekly downloads

2,808

version

5.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability