{"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/remarkjs/remark-retext/issues"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"dependencies":{"@types/mdast":"^4.0.0","@types/nlcst":"^2.0.0","mdast-util-to-nlcst":"^7.0.0","parse-latin":"^7.0.0","unified":"^11.0.0","vfile":"^6.0.0"},"description":"remark plugin to support retext","devDependencies":{"@types/node":"^22.0.0","c8":"^10.0.0","parse-english":"^7.0.0","prettier":"^3.0.0","remark-cli":"^12.0.0","remark-parse":"^11.0.0","remark-preset-wooorm":"^11.0.0","remark-stringify":"^11.0.0","retext-english":"^5.0.0","retext-stringify":"^4.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","xo":"^0.60.0"},"exports":"./index.js","funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"keywords":["markdown","mdast","natural language","nlcst","plugin","prose","remark","remark-plugin","retext","unified"],"license":"MIT","name":"remark-retext","prettier":{"bracketSpacing":false,"singleQuote":true,"semi":false,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-retext.git"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","format":"remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --100 --reporter lcov -- npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"sideEffects":false,"typeCoverage":{"atLeast":100,"strict":true},"type":"module","version":"6.0.1","xo":{"prettier":true},"_id":"remark-retext@6.0.1","gitHead":"fc2d264ccee621e24074da0de655ceff6be7f1bc","types":"./index.d.ts","homepage":"https://github.com/remarkjs/remark-retext#readme","_nodeVersion":"23.9.0","_npmVersion":"11.2.0","dist":{"integrity":"sha512-GZk8Fa/h88+OhmUlJuqEFX4Pi7OvgI3pq1bHyr/NJibTQxANH8/aZGoOflh4zDAwVDdvgoEk5XOJsWQ8UfjFnA==","shasum":"bebff574f4d988b738537e7daffdc16b1fac1032","tarball":"http://registry-npm.ywwl.com/remark-retext/download/remark-retext-6.0.1.tgz","fileCount":8,"unpackedSize":20932,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDB9deG5xX1zAyD0K4Jan4A7lScCCjPEM9m7wbKOA07pQIhAIynxD/HWEyqd7mdmWR5UMjn8W2BW+nTwS8Fquf4Tqsh"}],"size":6008,"noattachment":false,"key":"/remark-retext/-/remark-retext-6.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"remcohaszing","email":"remcohaszing@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-retext_6.0.1_1743597515948_0.30893297067972947"},"_hasShrinkwrap":false,"readme":"# remark-retext\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n\n**[remark][github-remark]** plugin to support\n**[retext][github-retext]**.\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(remarkRetext, destination[, options])`](#unifieduseremarkretext-destination-options)\n  * [`Options`](#options)\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][github-unified] ([remark][github-remark]) plugin to\nsupport [retext][github-retext].\n\n## When should I use this?\n\nThis project is useful if you want to check natural language in markdown.\nThe retext ecosystem has many useful plugins to check prose,\nsuch as [`retext-indefinite-article`][github-retext-indefinite-article]\nwhich checks that `a` and `an` are used correctly,\nor [`retext-readability`][github-retext-readability] which checks that sentences\nare not too complex.\nThis plugins lets you use them on markdown documents.\n\nThis plugin is not able to apply changes by retext plugins (such\nas done by `retext-smartypants`) to the markdown content.\n\nThis plugin is built on [`mdast-util-to-nlcst`][github-mdast-util-to-nlcst],\nwhich does the work on syntax trees.\nremark focusses on making it easier to transform content by abstracting such\ninternals away.\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 16+),\ninstall with [npm][npmjs-install]:\n\n```sh\nnpm install remark-retext\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkRetext from 'https://esm.sh/remark-retext@6'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import remarkRetext from 'https://esm.sh/remark-retext@6?bundle'\n</script>\n```\n\n## Use\n\nSay we have the following file `example.md`:\n\n```markdown\n## Hello guys!\n```\n\n…and a module `example.js`:\n\n```js\nimport remarkParse from 'remark-parse'\nimport remarkRetext from 'remark-retext'\nimport remarkStringify from 'remark-stringify'\nimport retextEnglish from 'retext-english'\nimport retextEquality from 'retext-equality'\nimport {read} from 'to-vfile'\nimport {unified} from 'unified'\nimport {reporter} from 'vfile-reporter'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkRetext, unified().use(retextEnglish).use(retextEquality))\n  .use(remarkStringify)\n  .process(await read('example.md'))\n\nconsole.error(reporter(file))\n```\n\n…then running `node example.js` yields:\n\n```text\nexample.md\n1:10-1:14 warning Unexpected potentially insensitive use of `guys`, in somes cases `people`, `persons`, `folks` may be better gals-man retext-equality\n\n⚠ 1 warning\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`remarkRetext`][api-remark-retext].\n\n### `unified().use(remarkRetext, destination[, options])`\n\nBridge or mutate to retext.\n\n###### Parameters\n\n* `destination` ([`Parser`][github-unified-parser] or\n  [`Processor`][github-unified-processor])\n  — configuration (required)\n\n###### Returns\n\nTransform ([`Transformer`][github-unified-transformer]).\n\n###### Notes\n\n* if a [processor][github-unified-processor] is given,\n  uses its parser to create a new nlcst tree,\n  then runs the plugins attached to with that\n  (*[bridge mode][github-unified-mode]*);\n  you can add a parser to processor for example with `parse-english`;\n  other plugins used on the processor should be retext plugins\n* if a [parser][github-unified-parser] is given,\n  uses it to create a new nlcst tree,\n  and returns it (*[mutate mode][github-unified-mode]*);\n  you can get a parser by importing `Parser` from `parse-english` for example;\n  other plugins used after `remarkRetext` should be retext plugins\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n* `options.ignore`\n  (`Array<string>`, optional)\n  — list of [mdast][github-mdast] node types to ignore;\n  the types `'table'`, `'tableRow'`, and `'tableCell'` are always ignored\n* `options.source`\n  (`Array<string>`, optional)\n  — list of [mdast][github-mdast] node types to mark as [nlcst][github-nlcst]\n  source nodes;\n  the type `'inlineCode'` is always marked as source\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,\nwe drop support for unmaintained versions of Node.\nThis means we try to keep the current release line,\n`remark-retext@6`,\ncompatible with Node.js 16.\n\nThis plugin works with `unified` version 6+,\n`remark` version 3+,\nand `retext` version 7+.\n\n## Security\n\nUse of `remark-retext` does not involve **[rehype][github-rehype]**\n(**[hast][github-hast]**) or user\ncontent so there are no openings for\n[cross-site scripting (XSS)][wikipedia-xss]\nattacks.\n\n## Related\n\n* [`rehype-retext`](https://github.com/rehypejs/rehype-retext)\n  — transform HTML ([hast][github-hast]) to natural language\n  ([nlcst][github-nlcst])\n* [`remark-rehype`](https://github.com/remarkjs/remark-rehype)\n  — transform markdown ([mdast][github-mdast]) to HTML ([hast][github-hast])\n* [`rehype-remark`](https://github.com/rehypejs/rehype-remark)\n  — transform HTML ([hast][github-hast]) to markdown ([mdast][github-mdast])\n* [`mdast-util-to-nlcst`][github-mdast-util-to-nlcst]\n  — underlying algorithm\n\n## Contribute\n\nSee [`contributing.md`][health-contributing] in [`remarkjs/.github`][health] for\nways to get started.\nSee [`support.md`][health-support] for ways to get help.\n\nThis project has a [code of conduct][health-coc].\nBy interacting with this repository,\norganization,\nor community you agree to abide by its terms.\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n<!-- Definitions -->\n\n[api-options]: #options\n\n[api-remark-retext]: #unifieduseremarkretext-destination-options\n\n[badge-build-image]: https://github.com/remarkjs/remark-retext/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/remarkjs/remark-retext/actions\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/remarkjs/remark-retext.svg\n\n[badge-coverage-url]: https://codecov.io/github/remarkjs/remark-retext\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/remark-retext.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/remark-retext\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/remark-retext\n\n[badge-size-url]: https://bundlejs.com/?q=remark-retext\n\n[esmsh]: https://esm.sh\n\n[file-license]: license\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[github-hast]: https://github.com/syntax-tree/hast\n\n[github-mdast]: https://github.com/syntax-tree/mdast\n\n[github-mdast-util-to-nlcst]: https://github.com/syntax-tree/mdast-util-to-nlcst\n\n[github-nlcst]: https://github.com/syntax-tree/nlcst\n\n[github-rehype]: https://github.com/rehypejs/rehype\n\n[github-remark]: https://github.com/remarkjs/remark\n\n[github-retext]: https://github.com/retextjs/retext\n\n[github-retext-indefinite-article]: https://github.com/retextjs/retext-indefinite-article\n\n[github-retext-readability]: https://github.com/retextjs/retext-readability\n\n[github-unified]: https://github.com/unifiedjs/unified\n\n[github-unified-mode]: https://github.com/unifiedjs/unified#processing-between-syntaxes\n\n[github-unified-parser]: https://github.com/unifiedjs/unified#parser\n\n[github-unified-processor]: https://github.com/unifiedjs/unified#processor\n\n[github-unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[health]: https://github.com/remarkjs/.github\n\n[health-coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[health-contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[health-support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[npmjs-install]: https://docs.npmjs.com/cli/install\n\n[typescript]: https://www.typescriptlang.org\n\n[wikipedia-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[wooorm]: https://wooorm.com\n","publish_time":1743597516111,"_cnpm_publish_time":1743597516111,"dist-tags":{"latest":"6.0.1"}}