# remark-comments

> This plugin parses custom Markdown syntax for Markdown source comments.

Latest version **1.2.10** (published 2024-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install remark-comments
pnpm add remark-comments
yarn add remark-comments
bun add remark-comments
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.10 |
| Published | 2024-04-27 |
| First published | 2017-06-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 237 |
| Author | Sébastien |
| Maintainers | situphen, talone |
| Keywords | remark |

## Links

- npm: https://www.npmjs.com/package/remark-comments
- Repository: https://github.com/zestedesavoir/zmarkdown.git#master
- Homepage: https://github.com/zestedesavoir/zmarkdown/tree/master#readme
- Issues: https://github.com/zestedesavoir/zmarkdown/issues
- npm.io page: https://npm.io/package/remark-comments

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 1.2.10 (latest) — 2024-04-27
- 1.2.9 — 2021-02-14
- 1.2.8 — 2019-08-29
- 1.2.7 — 2019-07-27
- 1.2.6 — 2019-04-14
- 1.2.5 — 2019-02-04
- 1.2.4 — 2018-11-23
- 1.2.3 — 2018-10-04
- 1.2.2 — 2018-08-09
- 1.2.1 — 2018-07-20
- 1.2.0 — 2018-03-06
- 1.1.0 — 2018-02-22
- 1.0.11 — 2018-02-21
- 1.0.10 — 2018-01-20
- 1.0.9 — 2018-01-19
- … 21 more at https://npm.io/package/remark-comments/versions

## README

# remark-comments [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status]

This plugin parses custom Markdown syntax for Markdown source comments.

## Syntax

You can insert comments in the Markdown source this way:

```markdown
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][mdast] specification)

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

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

## Installation

[npm][npm]:

```bash
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:

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

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

## Usage

Dependencies:

```javascript
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:

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

## License

[MIT][license] © [Zeste de Savoir][zds]

<!-- Definitions -->

[build-badge]: https://img.shields.io/travis/zestedesavoir/zmarkdown.svg

[build-status]: https://travis-ci.org/zestedesavoir/zmarkdown

[coverage-badge]: https://img.shields.io/coveralls/zestedesavoir/zmarkdown.svg

[coverage-status]: https://coveralls.io/github/zestedesavoir/zmarkdown

[license]: https://github.com/zestedesavoir/zmarkdown/blob/master/packages/remark-comments/LICENSE-MIT

[zds]: https://zestedesavoir.com

[npm]: https://www.npmjs.com/package/remark-comments

---
_Source: https://npm.io/package/remark-comments · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
