remark-comment-config

2018-11-14 admin

remark-comment-config是什么

什么是remark-comment-config,Configure remark with comments

remark-comment-config使用教程帮助文档

remark-comment-config Build Status Coverage Status Chat

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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-45390.html

文章标题:remark-comment-config

回到顶部