{"id":28573698,"url":"https://github.com/remarkjs/remark-textr","last_synced_at":"2025-06-10T21:19:31.193Z","repository":{"id":46338364,"uuid":"46299824","full_name":"remarkjs/remark-textr","owner":"remarkjs","description":"plugin to make your typography better with Textr","archived":false,"fork":false,"pushed_at":"2024-03-06T14:59:51.000Z","size":211,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-13T07:14:47.017Z","etag":null,"topics":["markdown","remark-plugins","textr","textr-plugins","typography"],"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":{"funding":{"github":"unifiedjs","open_collective":"unified"},"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}},"created_at":"2015-11-16T20:15:40.000Z","updated_at":"2025-03-24T01:50:29.000Z","dependencies_parsed_at":"2024-03-06T16:03:36.151Z","dependency_job_id":"5ca4c6f2-741e-48f6-a820-c53bfddf52ec","html_url":"https://github.com/remarkjs/remark-textr","commit_stats":{"total_commits":127,"total_committers":7,"mean_commits":"18.142857142857142","dds":0.5433070866141732,"last_synced_commit":"96ed5d0df9bee62fa7744b3d6c10a61ee85c1bfd"},"previous_names":["denysdovhan/remark-textr"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-textr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-textr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-textr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-textr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remarkjs","download_url":"https://codeload.github.com/remarkjs/remark-textr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remarkjs%2Fremark-textr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259152784,"owners_count":22813227,"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","remark-plugins","textr","textr-plugins","typography"],"created_at":"2025-06-10T21:19:05.831Z","updated_at":"2025-06-10T21:19:31.174Z","avatar_url":"https://github.com/remarkjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"readme":"# remark-textr\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 [improve typography][typewriter-habits] with\n**[Textr][]**.\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(remarkTextr[, options])`](#unifieduseremarktextr-options)\n    *   [`Options`](#options)\n    *   [`TextrPlugin`](#textrplugin)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([remark][]) plugin to support [Textr][].\n\n## When should I use this?\n\nThis project is useful if you want to automatically improve the text in your\nmarkdown documents.\n[Textr][] is a simple way to do that: no need to worry about ASTs.\nOn the other hand, ASTs are powerful, so some things are better done with\ncustom plugins: see [Create a plugin][unified-create-a-plugin].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install remark-textr\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport remarkTextr from 'https://esm.sh/remark-textr@6'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import remarkTextr from 'https://esm.sh/remark-textr@6?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay we have the following file `example.md`:\n\n````markdown\n## spread operator...\n\n```js\nfunction(...args) { return args; }\n```\n````\n\n…and a module `example.js`:\n\n```js\n/**\n * @typedef {import('remark-textr').TextrPlugin} TextrPlugin\n */\n\nimport {remark} from 'remark'\nimport remarkTextr from 'remark-textr'\nimport {read} from 'to-vfile'\n\nconst file = await remark()\n  .use(remarkTextr, {plugins: [ellipses]})\n  .process(await read('example.md'))\n\nconsole.log(String(file))\n\n/**\n * Replace triple dots with ellipses.\n *\n * @type {TextrPlugin}\n */\nfunction ellipses(input) {\n  return input.replace(/\\.{3}/gim, '…')\n}\n```\n\n…then running `node example.js` yields:\n\n````markdown\n## spread operator…\n\n```js\nfunction(...args) { return args; }\n```\n````\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`remarkTextr`][api-remark-text].\n\n### `unified().use(remarkTextr[, options])`\n\n[Improve typography][typewriter-habits] with [Textr][].\n\n###### Parameters\n\n*   `options` ([`Options`][api-options], optional)\n    — configuration\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n*   `options` (`object`, optional)\n    — configuration passed to `textr`;\n    for example, you may want to set the ISO 639-1 [locale code][textr-locale]\n    of the content, which is important for stuff like the correct primary and\n    secondary quotes\n*   `plugins` (`Array\u003cTextrPlugin | string\u003e`, optional)\n    — textr plugins;\n    if strings are passed in, those are loaded with `import`\n\n### `TextrPlugin`\n\nTextr plugin (TypeScript type).\n\nTextr plugins are available on npm labelled with a [`textr`][textr-plugins]\nkeyword.\nYou can also create them yourself, as shown in the example above.\n\n###### Parameters\n\n*   `value` (`string`)\n    — value to transform\n*   `options` (`object`)\n    — global configuration passed to textr\n\n###### Returns\n\nChanged text (`string`, optional).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`Options`][api-options] and\n[`TextrPlugin`][api-textr-plugin].\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-textr@^6`,\ncompatible with Node.js 16.\n\nThis plugin works with `unified` version 6+ and `remark` version 7+.\n\n## Security\n\nUse of `remark-textr` does not involve **[rehype][]** (**[hast][]**) or user\ncontent so there are no openings for [cross-site scripting (XSS)][wiki-xss]\nattacks.\n[Textr][] operates on text nodes, which are always escaped by remark.\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] © [Denys Dovhan][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/remarkjs/remark-textr/workflows/main/badge.svg\n\n[build]: https://github.com/remarkjs/remark-textr/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-textr.svg\n\n[coverage]: https://codecov.io/github/remarkjs/remark-textr\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-textr.svg\n\n[downloads]: https://www.npmjs.com/package/remark-textr\n\n[size-badge]: https://img.shields.io/bundlejs/size/remark-textr\n\n[size]: https://bundlejs.com/?q=remark-textr\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/HEAD/contributing.md\n\n[support]: https://github.com/remarkjs/.github/blob/HEAD/support.md\n\n[coc]: https://github.com/remarkjs/.github/blob/HEAD/code-of-conduct.md\n\n[license]: license\n\n[author]: https://denysdovhan.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[textr]: https://github.com/A/textr\n\n[textr-locale]: https://github.com/A/textr#locale-option-consistence\n\n[textr-plugins]: https://www.npmjs.com/browse/keyword/textr\n\n[typescript]: https://www.typescriptlang.org\n\n[typewriter-habits]: https://practicaltypography.com/typewriter-habits.html\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-create-a-plugin]: https://unifiedjs.com/learn/guide/create-a-plugin/\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[wiki-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[api-options]: #options\n\n[api-remark-text]: #unifieduseremarktextr-options\n\n[api-textr-plugin]: #textrplugin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-textr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremarkjs%2Fremark-textr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremarkjs%2Fremark-textr/lists"}