1.2.9 • Published 3 years ago

remark-comments v1.2.9

Weekly downloads
497
License
MIT
Repository
github
Last release
3 years ago

remark-comments Build Status Coverage Status

This plugin parses custom Markdown syntax for Markdown source comments.

Syntax

You can insert comments in the Markdown source this way:

Foo<--COMMENTS I am a comment COMMENTS-->bar

Everything between <--COMMENTS and COMMENTS--> will be absent from the HTML output. Compiling to Markdown will preserve all comments.

AST node (see mdast specification)

The plugin will product the following node and add it to the MDAST syntax tree:

interface Comments <: Node {
  type: "comments";
  data: {
    comment: string;
  }
}

Installation

npm:

npm install remark-comments

Configuration

Two options can be passed, as a single argument object:

{beginMarker = 'COMMENTS', endMarker = 'COMMENTS'}

Therefore, invoking this plugin this way:

  .use(remarkComments, {
    beginMarker: 'foo',
    endMarker: 'bar'
  })

will make this plugin remove what's put between <--foo and bar-->.

Usage

Dependencies:

const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')

const remarkComments = require('remark-comments')

Usage:

unified()
  .use(remarkParse)
  .use(remarkComments)
  .use(remark2rehype)
  .use(stringify)

License

MIT © Zeste de Savoir

1.2.9

3 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago