{"name":"remark-message-control","version":"4.2.0","description":"remark plugin to enable, disable, and ignore messages with remark","license":"MIT","keywords":["unified","remark","plugin","mdast","markdown","comment","message","marker","control"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-message-control.git"},"bugs":{"url":"https://github.com/remarkjs/remark-message-control/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},{"name":"Christian Murphy","email":"christian.murphy.42@gmail.com"}],"dependencies":{"mdast-comment-marker":"^1.0.0","unified-message-control":"^1.0.0","xtend":"^4.0.1"},"devDependencies":{"browserify":"^16.0.0","nyc":"^14.0.0","prettier":"^1.0.0","remark":"^10.0.0","remark-cli":"^6.0.0","remark-preset-wooorm":"^5.0.0","remark-toc":"^5.0.0","tape":"^4.0.0","tinyify":"^2.0.0","xo":"^0.24.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify . -s remarkMessageControl > remark-message-control.js","build-mangle":"browserify . -s remarkMessageControl -p tinyify > remark-message-control.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"rules":{"guard-for-in":"off"},"ignores":["remark-message-control.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"87132d7b295b0287815ba80abaecb0717f844d56","homepage":"https://github.com/remarkjs/remark-message-control#readme","_id":"remark-message-control@4.2.0","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-WXH2t5ljTyhsXlK1zPBLF3iPHbXl58R94phPMreS1xcHWBZJt6Oiu8RtNjy1poZFb3PqKnbYLJeR/CWcZ1bTFw==","shasum":"184c4a69ce6c4c707a5633fa35b0ce3dbf81f22c","tarball":"http://registry-npm.ywwl.com/remark-message-control/download/remark-message-control-4.2.0.tgz","fileCount":4,"unpackedSize":8540,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBeEECRA9TVsSAnZWagAA13cP/i0mTEmtdF99vFXHqOih\nw/PiqBDr+1JR97UGfc4plAFnrFUwzZrURsUsAo1BqrheaYcwf38y7zzQzmFD\nG/7ZvRp/3ym/zkIMW7Gc43YsFehf5a3F7b+BlGFBfcYR9GmD6vX4n/ySAChY\nRuDXgIklkbL8pUcY489ztSm4HBB76BWU8U+jIr04q4Uxz1JtdmjSJst9NBhk\naXhvraZECj9u7SYSm78v+jOv+XhvT1XTJYs5mTESYw7uPmgDGmfg14HrnH7s\n0OTuQC9qj7po90g7Np3delWNwRun5E13dGpH8JoFG37aO85F5gNX4cGp1zs4\nVuRtSDhvVebfY0WXfT21bW9inPdH54yF/up1g845/Grlm69MmjTaUL9dllrU\nBIzGISsuCiUGyRKJckLYlCaDGFDCW114mZreuwzwaihYZ8GMlHHZ+F6l3VCB\nUxjtfOxiA+cbQolCtf/Z1d4/1cV28sAirfuEqj2ECSbtVcO0zseh6KDMyY8r\n2vYsURCrZmC1sBOp6vabtcgu/FrhpEBdOrctac+SmBiBduia/3rfJtXTkQiS\n7rA3oD0owQbJkdZmnjx1gwQsxVNsKdRquuo293UnXwDmYgYVqGJqPz0Wrd/3\nrv7aTKUQc9rTcAw0t3guPR383BsiMTrCJOaFw37TOEOVY6buFAKYZQvMgzSb\nwURm\r\n=fXvh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/1PgpwjrfC3Z2s4UtF5MWr+hhHBi6jPEHJKTTVbcQCwIhAN9+H3eSQ61zW38UasViRp5LwVqkfC5hC9gDElX0ZyRI"}],"size":3440,"noattachment":false,"key":"/remark-message-control/-/remark-message-control-4.2.0.tgz"},"maintainers":[{"email":"Christian.Murphy.42@gmail.com","name":"christianmurphy"},{"email":"johnotander@gmail.com","name":"johno"},{"email":"merlijn@soverin.net","name":"murderlon"},{"email":"victor@draft.li","name":"vhf"},{"email":"tituswormer@gmail.com","name":"wooorm"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-message-control_4.2.0_1560666371332_0.07806957690608018"},"_hasShrinkwrap":false,"readme":"<!--lint disable no-html-->\n\n# remark-message-control\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[remark][]** plugin to enable, disable, and ignore messages with comments.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`unified().use(remarkMessageControl, options)`](#unifieduseremarkmessagecontrol-options)\n    *   [`Options`](#options)\n*   [Syntax](#syntax)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin that lets authors write\ncomments in markdown to show and hide messages.\n\n## When should I use this?\n\nYou can use this package when you’re building a linter such as\n[`remark-lint`][remark-lint].\nBut you probably don’t need to, because `remark-lint` already exists and it uses\nthis package.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install remark-message-control\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkMessageControl from 'https://esm.sh/remark-message-control@8'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import remarkMessageControl from 'https://esm.sh/remark-message-control@8?bundle'\n</script>\n```\n\n## Use\n\nSay we have the following file `example.md`:\n\n```markdown\n<!--foo ignore-->\n\n## Neptune\n```\n\n…and a module `example.js`:\n\n```js\n/**\n * @typedef {import('mdast').Root} Root\n */\n\nimport {remark} from 'remark'\nimport remarkMessageControl from 'remark-message-control'\nimport {read} from 'to-vfile'\nimport {reporter} from 'vfile-reporter'\n\nconst file = await remark()\n  .use(function () {\n    /** @param {Root} tree */\n    return function (tree, file) {\n      file.message('Whoops!', {\n        place: tree.children[1]?.position,\n        ruleId: 'thing',\n        source: 'foo'\n      })\n    }\n  })\n  .use(remarkMessageControl, {name: 'foo'})\n  .process(await read('example.md'))\n\nconsole.error(reporter(file))\n```\n\n…then running `node example.js` yields:\n\n```markdown\nexample.md: no issues found\n```\n\n> 👉 **Note**: without `remarkMessageControl`, we’d see:\n>\n> ```txt\n> example.md\n> 3:1-3:11 warning Whoops! thing foo\n>\n> ⚠ 1 warning\n> ```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`remarkMessageControl`][api-remark-message-control].\n\n### `unified().use(remarkMessageControl, options)`\n\nEnable, disable, and ignore messages with comments.\n\n###### Parameters\n\n*   `options` ([`Options`][api-options], **required**)\n    — configuration\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n*   `enable` (`Array<string>`, optional)\n    — list of `ruleId`s to initially turn on;\n    used if `reset` is `true`\n*   `disable` (`Array<string>`, optional)\n    — list of `ruleId`s to initially turn off;\n    used if `reset` is not `true`\n*   `known` (`Array<string>`, optional)\n    — list of allowed `ruleId`s\n*   `name` (`string`, **required**)\n    — name of markers that can control the message sources\n*   `reset` (`boolean`, default: `false`)\n    — whether to treat all messages as turned off initially\n*   `source` (`Array<string>` or `string`, default: `options.name`)\n    — [sources][vfile-message-fields] that can be controlled with markers\n\n<!--Old name of section-->\n\n<a name=\"markers\"></a>\n\n## Syntax\n\nThis plugin looks for comments in markdown (MDX is also supported).\nIf the first word in those comments does not match `options.name`, the comment\nis skipped.\nThe second word is expected to be `disable`, `enable`, or `ignore`.\nFurther words are rule identifiers of messages which are configurated.\n\nIn EBNF, the grammar looks as follows:\n\n<pre><code class=language-ebnf><a id=s-marker href=#s-marker>marker</a> ::= <a href=#s-identifier>identifier</a> <a href=#s-whitespace>whitespace</a>+ <a href=#s-keyword>keyword</a> <a href=#s-ruleidentifiers>ruleIdentifiers</a>?\n<a id=s-identifier href=#s-identifier>identifier</a> ::= <a href=#s-word>word</a>+ /* restriction: must match `options.name` */\n<a id=s-keyword href=#s-keyword>keyword</a> ::= 'enable' | 'disable' | 'ignore'\n<a id=s-ruleidentifiers href=#s-ruleidentifiers>ruleIdentifiers</a> ::= <a href=#s-word>word</a>+ (<a href=#s-whitespace>whitespace</a>+ <a href=#s-word>word</a>+)*\n<a id=s-whitespace href=#s-whitespace>whitespace</a> ::= ' ' | '\\t' | '\\r' | '\\n' | '\\f'\n<a id=s-word href=#s-word>word</a> ::= <a href=#s-letter>letter</a> | <a href=#s-digit>digit</a> | <a href=#s-punctuation>punctuation</a>\n<a id=s-letter href=#s-letter>letter</a> ::= <a href=#s-letterlowercase>letterLowercase</a> | <a href=#s-letteruppercase>letterUppercase</a>\n<a id=s-punctuation href=#s-punctuation>punctuation</a> ::= '-' | '_'\n<a id=s-letterlowercase href=#s-letterlowercase>letterLowercase</a> ::= 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'\n<a id=s-letteruppercase href=#s-letteruppercase>letterUppercase</a> ::= 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'\n<a id=s-digit href=#s-digit>digit</a> ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'\n</code></pre>\n\nWhich keyword is used defines how messages with those rule identifiers are\nhandled:\n\n###### `disable`\n\nThe **disable** keyword turns off all messages of the given rule identifiers.\nWhen without identifiers, all messages are turned off.\n\nFor example, to turn off certain messages:\n\n```markdown\n<!--lint disable list-item-bullet-indent strong-marker-->\n\n*   **foo**\n\nA paragraph, and now another list.\n\n  * __bar__\n```\n\n###### `enable`\n\nThe **enable** keyword turns on all messages of the given rule identifiers.\nWhen without identifiers, all messages are turned on.\n\nFor example, to enable certain messages:\n\n```markdown\n<!--lint enable strong-marker-->\n\n**foo** and __bar__.\n```\n\n###### `ignore`\n\nThe **ignore** keyword turns off all messages of the given `ruleId`s occurring\nin the following node.\nWhen without `ruleId`s, all messages are ignored.\n\nMessages are turned on again after the end of the following node.\n\nFor example, to turn off certain messages for the next node:\n\n```markdown\n<!--lint ignore list-item-bullet-indent strong-marker-->\n\n*   **foo**\n  * __bar__\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `remark-message-control@^8`,\ncompatible with Node.js 16.\n\nThis plugin works with `unified` version 6+ and `remark` version 7+.\n\n## Security\n\nUse of `remark-message-control` does not involve **[rehype][]** (**[hast][]**)\nor user content so there are no openings for [cross-site scripting\n(XSS)][wiki-xss] attacks.\nMessages may be hidden from user content though, causing builds to fail or pass,\nor changing a report.\n\n## Related\n\n*   [`remark-lint`][remark-lint]\n    — plugin to lint code style\n*   [`mdast-comment-marker`](https://github.com/syntax-tree/mdast-comment-marker)\n    — mdast utility to parse comment markers\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/remarkjs/remark-message-control/workflows/main/badge.svg\n\n[build]: https://github.com/remarkjs/remark-message-control/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-message-control.svg\n\n[coverage]: https://codecov.io/github/remarkjs/remark-message-control\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-message-control.svg\n\n[downloads]: https://www.npmjs.com/package/remark-message-control\n\n[size-badge]: https://img.shields.io/bundlejs/size/remark-message-control\n\n[size]: https://bundlejs.com/?q=remark-message-control\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/remarkjs/remark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/remarkjs/.github\n\n[contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[hast]: https://github.com/syntax-tree/hast\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[remark]: https://github.com/remarkjs/remark\n\n[remark-lint]: https://github.com/remarkjs/remark-lint\n\n[typescript]: https://www.typescriptlang.org\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[vfile-message-fields]: https://github.com/vfile/vfile-message#fields\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[api-options]: #options\n\n[api-remark-message-control]: #unifieduseremarkmessagecontrol-options\n","publish_time":1560666371555,"_cnpm_publish_time":1560666371555,"dist-tags":{"latest":"8.0.0"}}