{"id":21540962,"url":"https://github.com/reshape/retext","last_synced_at":"2025-04-10T04:11:13.872Z","repository":{"id":57354561,"uuid":"65311458","full_name":"reshape/retext","owner":"reshape","description":"plugin that adds the ability to transform the contents of any element","archived":false,"fork":false,"pushed_at":"2019-02-05T12:42:36.000Z","size":311,"stargazers_count":8,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T05:26:58.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/reshape.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-09T16:39:24.000Z","updated_at":"2018-07-25T17:59:52.000Z","dependencies_parsed_at":"2022-09-12T04:10:48.175Z","dependency_job_id":null,"html_url":"https://github.com/reshape/retext","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fretext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fretext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fretext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Fretext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reshape","download_url":"https://codeload.github.com/reshape/retext/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154990,"owners_count":21056543,"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":[],"created_at":"2024-11-24T05:00:41.473Z","updated_at":"2025-04-10T04:11:13.847Z","avatar_url":"https://github.com/reshape.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reshape Retext\n\n[![npm](https://img.shields.io/npm/v/reshape-retext.svg?style=flat-square)](https://npmjs.com/package/reshape-retext)\n[![tests](https://img.shields.io/travis/reshape/retext.svg?style=flat-square)](https://travis-ci.org/reshape/retext?branch=master)\n[![dependencies](https://img.shields.io/david/reshape/retext.svg?style=flat-square)](https://david-dm.org/reshape/retext)\n[![coverage](https://img.shields.io/coveralls/reshape/retext.svg?style=flat-square)](https://coveralls.io/r/reshape/retext?branch=master)\n\nPlugin wrapper over [Retext](https://github.com/wooorm/retext), an extensible system for analyzing and manipulating natural language.\n\n## Usage\n\n```js\nconst fs = require('fs')\nconst reshape = require('reshape')\nconst retext = require('reshape-retext')\nconst emoji = require('retext-emoji')\nconst smartypants = require('retext-smartypants')\n\nreshape({\n  plugins: retext([[emoji, { convert: 'encode' }], smartypants])\n}).process(fs.readFileSync('path/to/file.html', 'utf8'))\n  .then((result) =\u003e { fs.writeFileSync('path/to/file.html', 'utf8') })\n```\n\n#### Input html\n\n```html\n\u003chtml\u003e\n\u003cbody\u003e\n  \u003carticle class=\"my-article\"\u003e\n    \u003ch1\u003eHello \"world\"...\u003c/h1\u003e\n    \u003cp\u003eThe three wise monkeys [. . .] sometimes called the three mystic\n    apes--are a pictorial maxim. Together they embody the proverbial\n    principle to (\"see no evil, hear no evil, speak no evil\"). The\n    three monkeys are Mizaru (:see_no_evil:), covering his eyes, who\n    sees no evil; Kikazaru (:hear_no_evil:), covering his ears, who\n    hears no evil; and Iwazaru (:speak_no_evil:), covering his mouth,\n    who speaks no evil.\u003c/p\u003e\n  \u003c/article\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Output html\n\n```html\n\u003chtml\u003e\n\u003cbody\u003e\n  \u003carticle class=\"my-article\"\u003e\n    \u003ch1\u003eHello “world”…\u003c/h1\u003e\n    \u003cp\u003eThe three wise monkeys […] sometimes called the three mystic\n    apes—are a pictorial maxim. Together they embody the proverbial\n    principle to (“see no evil, hear no evil, speak no evil”). The\n    three monkeys are Mizaru (🙈), covering his eyes, who\n    sees no evil; Kikazaru (🙉), covering his ears, who\n    hears no evil; and Iwazaru (🙊), covering his mouth,\n    who speaks no evil.\u003c/p\u003e\n  \u003c/article\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Skipping Tags\n\nIf you'd like to have retext skip processing any any particular tag, you can add a `retext-skip` attribute to the tag. The plugin will not process the tag's contents, but will remove the attribute in the output. For example, the following input:\n\n```html\n\u003cp\u003e:tada:\u003c/p\u003e\n\u003cp retext-skip\u003e:tada:\u003c/p\u003e\n```\n\n...would produce this output:\n\n```html\n\u003cp\u003e🎉\u003c/p\u003e\n\u003cp\u003e:tada:\u003c/p\u003e\n```\n\n## License \u0026 Contributing\n\n- Licensed under [MIT](LICENSE.md)\n- See our [contributing guide](contributing.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Fretext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freshape%2Fretext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Fretext/lists"}