{"id":13783899,"url":"https://github.com/remarkjs/remark-retext","last_synced_at":"2025-06-10T21:19:22.173Z","repository":{"id":46338348,"uuid":"49385978","full_name":"remarkjs/remark-retext","owner":"remarkjs","description":"plugin to transform from remark (markdown) to retext (natural language)","archived":false,"fork":false,"pushed_at":"2025-04-02T12:38:33.000Z","size":132,"stargazers_count":30,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-11T19:40:27.621Z","etag":null,"topics":["markdown","mdast","natural-language","nlcst","remark","retext"],"latest_commit_sha":null,"homepage":"https://remark.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remarkjs.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2016-01-10T21:20:22.000Z","updated_at":"2025-04-02T13:12:11.000Z","dependencies_parsed_at":"2024-06-18T15:53:15.831Z","dependency_job_id":"02d4527b-ead1-49e5-9361-c59214e0ee97","html_url":"https://github.com/remarkjs/remark-retext","commit_stats":{"total_commits":101,"total_committers":2,"mean_commits":50.5,"dds":0.01980198019801982,"last_synced_commit":"4395bc6112d04cb8f336b237796d65f52e9ca8fc"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-retext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-retext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-retext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-retext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkjs","download_url":"https://codeload.github.com/remarkjs/remark-retext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-retext/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258453262,"owners_count":22703630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","mdast","natural-language","nlcst","remark","retext"],"created_at":"2024-08-03T19:00:32.702Z","updated_at":"2025-06-10T21:19:21.914Z","avatar_url":"https://github.com/remarkjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["Plugins"],"sub_categories":[],"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\u003cscript type=\"module\"\u003e\n  import remarkRetext from 'https://esm.sh/remark-retext@6?bundle'\n\u003c/script\u003e\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\u003cstring\u003e`, 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\u003cstring\u003e`, 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\u003c!-- Definitions --\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-retext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkjs%2Fremark-retext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-retext/lists"}