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
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