{"id":20827003,"url":"https://github.com/retextjs/retext-smartypants","last_synced_at":"2025-12-12T03:43:41.622Z","repository":{"id":17657441,"uuid":"20462026","full_name":"retextjs/retext-smartypants","owner":"retextjs","description":"plugin to implement SmartyPants","archived":false,"fork":false,"pushed_at":"2024-10-22T15:30:55.000Z","size":277,"stargazers_count":54,"open_issues_count":0,"forks_count":8,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-08-10T12:40:20.605Z","etag":null,"topics":["backtick","dash","ellipses","natural-language","quotes","retext","retext-plugin","smartypants"],"latest_commit_sha":null,"homepage":"https://retextjs.github.io/retext-smartypants","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/retextjs.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},"funding":{"github":"unifiedjs","open_collective":"unified"}},"created_at":"2014-06-03T22:27:24.000Z","updated_at":"2024-10-10T10:36:59.000Z","dependencies_parsed_at":"2024-01-13T11:27:53.733Z","dependency_job_id":"2b2c25d8-a582-4c7b-90f6-77baabd1b2fd","html_url":"https://github.com/retextjs/retext-smartypants","commit_stats":{"total_commits":181,"total_committers":3,"mean_commits":"60.333333333333336","dds":"0.016574585635359074","last_synced_commit":"f266eee72d90de8011864dbd1dc1abed3c9da986"},"previous_names":["wooorm/retext-smartypants"],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/retextjs/retext-smartypants","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-smartypants","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-smartypants/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-smartypants/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-smartypants/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retextjs","download_url":"https://codeload.github.com/retextjs/retext-smartypants/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-smartypants/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270899579,"owners_count":24664720,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backtick","dash","ellipses","natural-language","quotes","retext","retext-plugin","smartypants"],"created_at":"2024-11-17T23:10:47.508Z","updated_at":"2025-12-12T03:43:36.579Z","avatar_url":"https://github.com/retextjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":[],"sub_categories":[],"readme":"# retext-smartypants\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**[retext][]** plugin to apply [SmartyPants][].\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(retextSmartypants[, options])`](#unifieduseretextsmartypants-options)\n  * [`Options`](#options)\n  * [`QuoteCharacterMap`](#quotecharactermap)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([retext][]) plugin to apply [SmartyPants][] to\nthe syntax tree.\nIt replaces straight/typewriter punctuation marks and symbols with smart/curly\nmarks and symbols.\n\n## When should I use this?\n\nYou can use this plugin any time there straight marks and symbols in prose,\nbut you want to use smart ones instead.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install retext-smartypants\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport retextSmartypants from 'https://esm.sh/retext-smartypants@6'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import retextSmartypants from 'https://esm.sh/retext-smartypants@6?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {retext} from 'retext'\nimport retextSmartypants from 'retext-smartypants'\n\nconst file = await retext()\n  .use(retextSmartypants)\n  .process('He said, \"A \\'simple\\' english sentence. . .\"')\n\nconsole.log(String(file))\n```\n\nYields:\n\n```txt\nHe said, “A ‘simple’ english sentence…”\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`retextSmartypants`][api-retext-smartypants].\n\n### `unified().use(retextSmartypants[, options])`\n\nReplace straight punctuation marks with curly ones.\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* `backticks` (`boolean` or `'all'`, default: `true`)\n  — transform backticks;\n  when `true`, turns double backticks into an opening double quote and\n  double straight single quotes into a closing double quote;\n  when `'all'`, does that and turns single backticks into an opening\n  single quote and a straight single quotes into a closing single smart\n  quote;\n  `quotes: false` must be used with `backticks: 'all'`\n* `closingQuotes` ([`QuoteCharacterMap`][api-quote-character-map], default:\n  `{double: '”', single: '’'}`)\n  — closing quotes to use\n* `dashes` (`'inverted'` or `'oldschool'` or `boolean`, default: `true`)\n  — transform dashes;\n  when `true`, turns two dashes into an em dash character;\n  when `'oldschool'`, turns three dashes into an em dash and two into an en\n  dash;\n  when `'inverted'`, turns three dashes into an en dash and two into an em\n  dash\n* `ellipses` (`'spaced'` or `'unspaced'` or `boolean`, default: `true`)\n  — transform triple dots;\n  when `'spaced'`, turns triple dots with spaces into ellipses;\n  when `'unspaced'`, turns triple dots without spaces into ellipses;\n  when `true`, turns triple dots with or without spaces into ellipses\n* `openingQuotes` ([`QuoteCharacterMap`][api-quote-character-map], default:\n  `{double: '“', single: '‘'}`)\n  — opening quotes to use\n* `quotes` (`boolean`, default: `true`)\n  — transform straight quotes into smart quotes\n\n### `QuoteCharacterMap`\n\nQuote characters (TypeScript type).\n\n###### Fields\n\n* `double` (`string`)\n  — character to use for double quotes\n* `single` (`string`)\n  — character to use for single quotes\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`Options`][api-options] and\n[`QuoteCharacterMap`][api-quote-character-map].\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, `retext-smartypants@^6`,\ncompatible with Node.js 16.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`retextjs/.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\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/retextjs/retext-smartypants/workflows/main/badge.svg\n\n[build]: https://github.com/retextjs/retext-smartypants/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/retextjs/retext-smartypants.svg\n\n[coverage]: https://codecov.io/github/retextjs/retext-smartypants\n\n[downloads-badge]: https://img.shields.io/npm/dm/retext-smartypants.svg\n\n[downloads]: https://www.npmjs.com/package/retext-smartypants\n\n[size-badge]: https://img.shields.io/bundlejs/size/retext-smartypants\n\n[size]: https://bundlejs.com/?q=retext-smartypants\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/retextjs/retext/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[typescript]: https://www.typescriptlang.org\n\n[health]: https://github.com/retextjs/.github\n\n[contributing]: https://github.com/retextjs/.github/blob/main/contributing.md\n\n[support]: https://github.com/retextjs/.github/blob/main/support.md\n\n[coc]: https://github.com/retextjs/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[smartypants]: https://daringfireball.net/projects/smartypants\n\n[retext]: https://github.com/retextjs/retext\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[api-options]: #options\n\n[api-quote-character-map]: #quotecharactermap\n\n[api-retext-smartypants]: #unifieduseretextsmartypants-options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretextjs%2Fretext-smartypants","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretextjs%2Fretext-smartypants","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretextjs%2Fretext-smartypants/lists"}