diff --git a/readme.md b/readme.md index 8c3143a..06a5a41 100644 --- a/readme.md +++ b/readme.md @@ -3,22 +3,25 @@ [![Build][build-badge]][build] [![Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] [![Chat][chat-badge]][chat] -Bridge / mutate from [**rehype**][rehype] to [**retext**][retext]. +[**rehype**][rehype] plugin to bridge or mutate to [**retext**][retext]. -Uses [`hast-util-to-nlcst`][hast-util-to-nlcst] under the hood. See its -documentation to learn how to ignore nodes. +Uses [`hast-util-to-nlcst`][to-nlcst] under the hood. +See its documentation to learn how to ignore nodes. -## Installation +## Install [npm][]: -```bash +```sh npm install rehype-retext ``` -## Usage +## Use Say `example.html` looks as follows: @@ -32,9 +35,9 @@ Say `example.html` looks as follows: ``` -...and `example.js` like this: +…and `example.js` like this: -```javascript +```js var vfile = require('to-vfile') var report = require('vfile-reporter') var unified = require('unified') @@ -78,42 +81,45 @@ example.html ### `origin.use(rehype2retext, destination)` -Either bridge or mutate from [**rehype**][rehype] ([HAST][]) to -[**retext**][retext] ([NLCST][]). +[**rehype**][rehype] ([hast][]) plugin to bridge or mutate to +[**retext**][retext] ([nlcst][]). ###### `destination` `destination` is either a parser or a processor. -If a [`Unified`][processor] processor is given, runs the destination -processor with the new NLCST tree, then, after running discards that -tree and continues on running the origin processor with the original -tree ([bridge-mode][bridge]). +If a processor ([`Unified`][processor]) is given, runs the destination +processor with the new nlcst tree, then, after running discards that tree and +continues on running the origin processor with the original tree +([bridge-mode][bridge]). -If a parser (such as [**parse-latin**][latin], [**parse-english**][english], -or [**parse-dutch**][dutch]) is given, passes the tree to further -plug-ins (mutate-mode). +If a parser (such as [**parse-latin**][latin], [**parse-english**][english], or +[**parse-dutch**][dutch]) is given, passes the tree to further plugins +(mutate-mode). -As HTML defines paragraphs, that definition is used for NLCST -`ParagraphNode`s: `

` and `` are explicitly supported, -and implicit paragraphs in flow content are also supported. +As HTML defines paragraphs, that definition is used for +[**Paragraph**][paragraph]s: `

` and `` are explicitly +supported, and implicit paragraphs in flow content are also supported. ## Related -* [`rehype-remark`](https://github.com/rehypejs/rehype-remark) - — Transform HTML to markdown -* [`remark-rehype`](https://github.com/wooorm/remark-rehype) - — Transform markdown to HTML -* [`remark-retext`](https://github.com/wooorm/remark-retext) - — Transform markdown to [NLCST][] +* [`rehype-remark`](https://github.com/rehypejs/rehype-retext) + — Transform HTML ([**hast**][hast]) to Markdown ([**mdast**][mdast]) +* [`remark-retext`](https://github.com/remarkjs/remark-retext) + — Transform Markdown ([**mdast**][mdast]) to natural language + ([**nlcst**][nlcst]) +* [`remark-rehype`](https://github.com/remarkjs/remark-rehype) + — Transform Markdown ([**mdast**][mdast]) to HTML ([**hast**][hast]) ## Contribute -See [`contributing.md` in `rehypejs/rehype`][contribute] for ways to get -started. +See [`contributing.md`][contributing] in [`rehypejs/.github`][health] for ways +to get started. +See [`support.md`][support] for ways to get help. -This organisation has a [Code of Conduct][coc]. By interacting with this -repository, organisation, or community you agree to abide by its terms. +This project has a [Code of Conduct][coc]. +By interacting with this repository, organisation, or community you agree to +abide by its terms. ## License @@ -133,36 +139,54 @@ repository, organisation, or community you agree to abide by its terms. [downloads]: https://www.npmjs.com/package/rehype-retext +[size-badge]: https://img.shields.io/bundlephobia/minzip/rehype-retext.svg + +[size]: https://bundlephobia.com/result?p=rehype-retext + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + [chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg [chat]: https://spectrum.chat/unified/rehype [npm]: https://docs.npmjs.com/cli/install +[health]: https://github.com/rehypejs/.github + +[contributing]: https://github.com/rehypejs/.github/blob/master/contributing.md + +[support]: https://github.com/rehypejs/.github/blob/master/support.md + +[coc]: https://github.com/rehypejs/.github/blob/master/code-of-conduct.md + [license]: license [author]: https://wooorm.com -[hast]: https://github.com/syntax-tree/hast - [rehype]: https://github.com/rehypejs/rehype -[retext]: https://github.com/wooorm/retext +[retext]: https://github.com/retextjs/retext [processor]: https://github.com/unifiedjs/unified#processor [bridge]: https://github.com/unifiedjs/unified#processing-between-syntaxes +[hast]: https://github.com/syntax-tree/hast + +[mdast]: https://github.com/syntax-tree/mdast + [nlcst]: https://github.com/syntax-tree/nlcst +[paragraph]: https://github.com/syntax-tree/nlcst#paragraph + +[to-nlcst]: https://github.com/syntax-tree/hast-util-to-nlcst + [latin]: https://github.com/wooorm/parse-latin [english]: https://github.com/wooorm/parse-english [dutch]: https://github.com/wooorm/parse-dutch - -[hast-util-to-nlcst]: https://github.com/syntax-tree/hast-util-to-nlcst - -[contribute]: https://github.com/rehypejs/rehype/blob/master/contributing.md - -[coc]: https://github.com/rehypejs/rehype/blob/master/code-of-conduct.md