Skip to content

Commit

Permalink
Refactor prose
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 17, 2019
1 parent e2f9325 commit 9affdd5
Showing 1 changed file with 49 additions and 39 deletions.
88 changes: 49 additions & 39 deletions readme.md
Expand Up @@ -3,24 +3,25 @@
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Chat][chat-badge]][chat]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

Bridge / mutate from [**remark**][remark] to [**rehype**][rehype].
[**remark**][remark] plugin to bridge or mutate to [**rehype**][rehype].

> Note that `remark-rehype` doesn’t deal with HTML inside the markdown. You’ll
> need [`rehype-raw`][raw] if you’re planning on doing that.
> Note: `remark-rehype` doesn’t deal with HTML inside the Markdown.
> You’ll need [`rehype-raw`][raw] if you’re planning on doing that.
## Installation
## Install

[npm][npm-install]:
[npm][]:

```bash
```sh
npm install remark-rehype
```

## Usage
## Use

Say we have the following file, `example.md`:

Expand All @@ -34,7 +35,7 @@ Some _emphasis_, **importance**, and `code`.

And our script, `example.js`, looks as follows:

```javascript
```js
var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
Expand Down Expand Up @@ -81,47 +82,48 @@ example.md: no issues found

### `origin.use(remark2rehype[, destination][, options])`

Either bridge or mutate from [**remark**][remark] ([MDAST][]) to
[**rehype**][rehype] ([HAST][]).
[**remark**][remark] ([**mdast**][mdast]) plugin to bridge or mutate to
[**rehype**][rehype] ([**hast**][hast]).

###### `destination`

If given ([`Unified`][processor]), runs the destination processor
with the new HAST tree, then, after running discards that tree and
continues on running the origin processor with the original tree
([bridge-mode][bridge]). Otherwise, passes the tree to further
plug-ins (mutate-mode).
If a [`Unified`][processor] processor is given, runs the destination processor
with the new hast tree, then, after running discards that tree and continues on
running the origin processor with the original tree ([*bridge mode*][bridge]).
Otherwise, passes the tree to further plugins (*mutate mode*).

###### `options`

`options` are passed through to [`mdast-util-to-hast`][to-hast], if given.
Passed to [`mdast-util-to-hast`][to-hast].

## Related

* [`rehype-raw`][raw]
— Properly deal with HTML in markdown (used after `remark-rehype`)
— Properly deal with HTML in Markdown (used after `remark-rehype`)
* [`rehype-remark`](https://github.com/rehypejs/rehype-remark)
— Transform HTML to markdown
— Transform HTML ([hast][]) to Markdown ([mdast][])
* [`rehype-retext`](https://github.com/rehypejs/rehype-retext)
— Transform HTML to [NLCST][]
— Transform HTML ([hast][]) to natural language ([nlcst][])
* [`remark-retext`](https://github.com/remarkjs/remark-retext)
— Transform markdown to [NLCST][]
— Transform Markdown ([mdast][]) to natural language ([nlcst][])

## Contribute

See [`contributing.md` in `remarkjs/remark`][contributing] for ways to get
started.
See [`contributing.md`][contributing] in [`remarkjs/.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

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://img.shields.io/travis/remarkjs/remark-rehype.svg
[build-badge]: https://img.shields.io/travis/remarkjs/remark-rehype/master.svg

[build]: https://travis-ci.org/remarkjs/remark-rehype

Expand All @@ -133,40 +135,48 @@ repository, organisation, or community you agree to abide by its terms.

[downloads]: https://www.npmjs.com/package/remark-rehype

[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-rehype.svg

[chat]: https://spectrum.chat/unified/remark
[size]: https://bundlephobia.com/result?p=remark-rehype

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[npm-install]: https://docs.npmjs.com/cli/install
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg

[license]: license
[chat]: https://spectrum.chat/unified/remark

[author]: https://wooorm.com
[npm]: https://docs.npmjs.com/cli/install

[mdast]: https://github.com/syntax-tree/mdast
[health]: https://github.com/remarkjs/.github

[hast]: https://github.com/syntax-tree/hast
[contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md

[remark]: https://github.com/remarkjs/remark
[support]: https://github.com/remarkjs/.github/blob/master/support.md

[rehype]: https://github.com/rehypejs/rehype
[coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md

[license]: license

[author]: https://wooorm.com

[processor]: https://github.com/unifiedjs/unified#processor

[bridge]: https://github.com/unifiedjs/unified#processing-between-syntaxes

[to-hast]: https://github.com/syntax-tree/mdast-util-to-hast#tohastnode-options
[remark]: https://github.com/remarkjs/remark

[nlcst]: https://github.com/syntax-tree/nlcst
[rehype]: https://github.com/rehypejs/rehype

[raw]: https://github.com/rehypejs/rehype-raw

[contributing]: https://github.com/remarkjs/remark/blob/master/contributing.md
[mdast]: https://github.com/syntax-tree/mdast

[hast]: https://github.com/syntax-tree/hast

[coc]: https://github.com/remarkjs/remark/blob/master/code-of-conduct.md
[nlcst]: https://github.com/syntax-tree/nlcst

[to-hast]: https://github.com/syntax-tree/mdast-util-to-hast#tohastnode-options

0 comments on commit 9affdd5

Please sign in to comment.