Skip to content

Commit 68a9a92

Browse files
committed
Refactor prose
1 parent 64f9098 commit 68a9a92

File tree

1 file changed

+46
-16
lines changed

1 file changed

+46
-16
lines changed

readme.md

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
# mdast-util-compact [![Build][build-badge]][build] [![Coverage][coverage-badge]][coverage] [![Downloads][downloads-badge]][downloads] [![Chat][chat-badge]][chat]
1+
# mdast-util-compact
22

3-
Make [mdast][] trees compact: collapse text nodes (when possible),
4-
and blockquotes (in commonmark mode).
3+
[![Build][build-badge]][build]
4+
[![Coverage][coverage-badge]][coverage]
5+
[![Downloads][downloads-badge]][downloads]
6+
[![Size][size-badge]][size]
7+
[![Sponsors][sponsors-badge]][collective]
8+
[![Backers][backers-badge]][collective]
9+
[![Chat][chat-badge]][chat]
510

6-
## Installation
11+
[**mdast**][mdast] utility to make trees compact: collapse text nodes (when
12+
possible) and blockquotes (in commonmark mode).
13+
14+
## Install
715

816
[npm][]:
917

10-
```bash
18+
```sh
1119
npm install mdast-util-compact
1220
```
1321

1422
## Usage
1523

16-
```javascript
24+
```js
1725
var u = require('unist-builder')
1826
var compact = require('mdast-util-compact')
1927

@@ -35,23 +43,25 @@ Yields:
3543

3644
### `compact(tree[, commonmark])`
3745

38-
Visit the tree and collapse nodes. Combines adjacent text nodes (but
39-
not when they represent entities or escapes). If `commonmark` is `true`,
40-
collapses `blockquote` nodes.
46+
Walk the [tree][] and collapse nodes.
47+
Combines adjacent [text][]s (but not when they represent entities or escapes).
48+
If `commonmark` is `true`, collapses [blockquote][]s.
4149

42-
Handles positional information properly.
50+
Handles [positional information][position-information] properly.
4351

4452
###### Returns
4553

4654
The given `tree`.
4755

4856
## Contribute
4957

50-
See [`contributing.md` in `syntax-tree/mdast`][contributing] for ways to get
58+
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
5159
started.
60+
See [`support.md`][support] for ways to get help.
5261

53-
This organisation has a [Code of Conduct][coc]. By interacting with this
54-
repository, organisation, or community you agree to abide by its terms.
62+
This project has a [Code of Conduct][coc].
63+
By interacting with this repository, organisation, or community you agree to
64+
abide by its terms.
5565

5666
## License
5767

@@ -71,18 +81,38 @@ repository, organisation, or community you agree to abide by its terms.
7181

7282
[downloads]: https://www.npmjs.com/package/mdast-util-compact
7383

84+
[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-compact.svg
85+
86+
[size]: https://bundlephobia.com/result?p=mdast-util-compact
87+
88+
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
89+
90+
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
91+
92+
[collective]: https://opencollective.com/unified
93+
7494
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
7595

76-
[chat]: https://spectrum.chat/unified/remark
96+
[chat]: https://spectrum.chat/unified/syntax-tree
7797

7898
[npm]: https://docs.npmjs.com/cli/install
7999

80100
[license]: license
81101

82102
[author]: https://wooorm.com
83103

104+
[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md
105+
106+
[support]: https://github.com/syntax-tree/.github/blob/master/support.md
107+
108+
[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md
109+
84110
[mdast]: https://github.com/syntax-tree/mdast
85111

86-
[contributing]: https://github.com/syntax-tree/mdast/blob/master/contributing.md
112+
[tree]: https://github.com/syntax-tree/unist#tree
113+
114+
[position-information]: https://github.com/syntax-tree/unist#positional-information
115+
116+
[text]: https://github.com/syntax-tree/mdast#text
87117

88-
[coc]: https://github.com/syntax-tree/mdast/blob/master/code-of-conduct.md
118+
[blockquote]: https://github.com/syntax-tree/mdast#blockquote

0 commit comments

Comments
 (0)