{"id":18600197,"url":"https://github.com/giraugh/rehype-to-text","last_synced_at":"2025-05-16T15:37:55.455Z","repository":{"id":224438735,"uuid":"763252525","full_name":"giraugh/rehype-to-text","owner":"giraugh","description":"Rehype plugin to compile a rehype AST to text using `hast-util-to-text`","archived":false,"fork":false,"pushed_at":"2024-02-26T00:02:11.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T23:11:58.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/rehype-to-text","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giraugh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-25T23:30:04.000Z","updated_at":"2024-02-26T00:02:41.000Z","dependencies_parsed_at":"2024-02-26T00:44:03.360Z","dependency_job_id":null,"html_url":"https://github.com/giraugh/rehype-to-text","commit_stats":null,"previous_names":["giraugh/rehype-to-text"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giraugh%2Frehype-to-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giraugh%2Frehype-to-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giraugh%2Frehype-to-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giraugh%2Frehype-to-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giraugh","download_url":"https://codeload.github.com/giraugh/rehype-to-text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254557309,"owners_count":22091091,"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-07T02:03:23.202Z","updated_at":"2025-05-16T15:37:55.434Z","avatar_url":"https://github.com/giraugh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rehype-to-text\n\nRehype plugin that compiles a hast tree to string using [`hast-util-to-text`](https://github.com/syntax-tree/hast-util-to-text)\n\n\n## Usage\n\nInstall plugin with\n\n```bash\nnpm i rehype-to-text\n```\n\nThen use `rehypeToText` as the last plugin in your `unified` chain.\n\n```ts\nimport { unified } from \"unified\";\nimport rehypeParse from \"rehype-parse\";\nimport rehypeToText from \"rehype-to-text\";\n\nconst plainText = (\n    await unified()\n        .use(rehypeParse, { fragment: true })\n        .use(rehypeToText, { whitespace: \"pre\" })\n        .process(myHtml)\n).toString();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiraugh%2Frehype-to-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiraugh%2Frehype-to-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiraugh%2Frehype-to-text/lists"}