{"id":30145309,"url":"https://github.com/grawl/posthtml-richtypo","last_synced_at":"2025-08-11T08:12:19.176Z","repository":{"id":57339130,"uuid":"268987674","full_name":"Grawl/posthtml-richtypo","owner":"Grawl","description":"Process HTML node text with Richtypo","archived":false,"fork":false,"pushed_at":"2020-06-18T19:28:05.000Z","size":20,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T17:52:03.246Z","etag":null,"topics":["posthtml","posthtml-plugin","richtypo","typography"],"latest_commit_sha":null,"homepage":"","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/Grawl.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-03T04:18:20.000Z","updated_at":"2024-07-14T10:00:21.000Z","dependencies_parsed_at":"2022-08-28T10:00:13.369Z","dependency_job_id":null,"html_url":"https://github.com/Grawl/posthtml-richtypo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Grawl/posthtml-richtypo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grawl%2Fposthtml-richtypo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grawl%2Fposthtml-richtypo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grawl%2Fposthtml-richtypo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grawl%2Fposthtml-richtypo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Grawl","download_url":"https://codeload.github.com/Grawl/posthtml-richtypo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Grawl%2Fposthtml-richtypo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269850366,"owners_count":24485177,"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-11T02:00:10.019Z","response_time":75,"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":["posthtml","posthtml-plugin","richtypo","typography"],"created_at":"2025-08-11T08:12:17.573Z","updated_at":"2025-08-11T08:12:19.162Z","avatar_url":"https://github.com/Grawl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostHTML [Richtypo] plugin \u003cimg align=\"right\" width=\"220\" height=\"200\" title=\"PostHTML logo\" src=\"http://posthtml.github.io/posthtml/logo.svg\"\u003e\n\n[![NPM][npm]][npm-url]\n[![Deps][deps]][deps-url]\n[![Build][build]][build-badge]\n[![Coverage][cover]][cover-badge]\n[![Standard Code Style][style]][style-url]\n[![Chat][chat]][chat-badge]\n\nApply typography rules to text into HTML node\n\nBefore:\n\n``` html\n\u003cp data-richtypo\u003eThere are 1000 \"rules\" to enrich your text\u003c/p\u003e\n```\n\nAfter:\n\n``` html\n\u003cp data-richtypo\u003eThere are 1000 «rules» to\u0026nbsp;enrich your\u0026nbsp;text\u003c/p\u003e\n```\n\n## Install\n\n```\nnpm i posthtml posthtml-richtypo\n```\n\n## Usage\n\n``` js\nconst fs = require('fs');\nconst posthtml = require('posthtml');\nconst richtypoPlugin = require('posthtml-richtypo');\nconst {\n    quotes,\n    sectionSigns,\n    shortWords,\n} = require('richtypo-rules-ru');\n\nposthtml()\n    .use(richtypoPlugin({\n        attribute: 'data-typo',\n        rules: [\n            quotes,\n            sectionSigns,\n            shortWords,\n        ],\n    }))\n    .process(html)\n    .then(result =\u003e fs.writeFileSync('./after.html', result.html));\n```\n\n## Options\n\n#### `{string} attribute` to change text into\n\nDefault: `'data-richtypo'`\n\n#### `{array} rules` to apply typography\n\nDefault: [`richtypo-rules-en`](https://www.npmjs.com/package/richtypo-rules-en)\n\n[Richtypo rules](https://github.com/sapegin/richtypo.js/tree/master/packages)\n\n## TODO\n\n- [ ] More flexible replacement for 'attribute' (but PostHTML have nothing like CSS selectors)\n- [ ] Allow providing rules by names, like 'ru' or 'fr'\n- [ ] Remove `richtypo-rules-en` from dependencies, use common rules as fallback\n- [ ] Fix tests\n- [ ] Fix coverage\n\n### Contributing\n\nSee [PostHTML Guidelines](https://github.com/posthtml/posthtml/tree/master/docs) and [contribution guide](contributing.md).\n\n### License [MIT](license)\n\n[Richtypo]: https://github.com/sapegin/richtypo.js\n\n[npm]: https://img.shields.io/npm/v/posthtml-richtypo.svg\n[npm-url]: https://npmjs.com/package/posthtml-richtypo\n\n[deps]: https://david-dm.org/Grawl/posthtml-richtypo.svg\n[deps-url]: https://david-dm.org/Grawl/posthtml-richtypo\n\n[style]: https://img.shields.io/badge/code%20style-standard-yellow.svg\n[style-url]: http://standardjs.com/\n\n[build]: https://travis-ci.org/Grawl/posthtml-richtypo.svg?branch=master\n[build-badge]: https://travis-ci.org/Grawl/posthtml-richtypo?branch=master\n\n[cover]: https://coveralls.io/repos/Grawl/posthtml-richtypo/badge.svg?branch=master\n[cover-badge]: https://coveralls.io/r/Grawl/posthtml-richtypo?branch=master\n\n\n[chat]: https://badges.gitter.im/posthtml/posthtml.svg\n[chat-badge]: https://gitter.im/posthtml/posthtml?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrawl%2Fposthtml-richtypo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrawl%2Fposthtml-richtypo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrawl%2Fposthtml-richtypo/lists"}