Skip to content

Commit f85c1a1

Browse files
committed
Add improved docs
1 parent 2ef9a5b commit f85c1a1

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

readme.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You should try and keep your trees clean yourself.
3939
## Install
4040

4141
This package is [ESM only][esm].
42-
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
42+
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
4343

4444
```sh
4545
npm install mdast-util-compact
@@ -83,14 +83,17 @@ Yields:
8383

8484
## API
8585

86-
This package exports the identifier `compact`.
86+
This package exports the identifier [`compact`][api-compact].
8787
There is no default export.
8888

8989
### `compact(tree)`
9090

91-
Collapse nodes in `tree` ([`Node`][node]).
92-
Combines adjacent texts and collapses blockquotes.
93-
Handles [positional information][position-information] properly.
91+
Make an mdast tree compact by merging adjacent text nodes and block quotes.
92+
93+
###### Parameters
94+
95+
* `tree` ([`Node`][node])
96+
— tree to change
9497

9598
###### Returns
9699

@@ -99,13 +102,13 @@ The given `tree` ([`Node`][node]).
99102
## Types
100103

101104
This package is fully typed with [TypeScript][].
102-
There are no additional types exported.
105+
It exports no additional types.
103106

104107
## Compatibility
105108

106109
Projects maintained by the unified collective are compatible with all maintained
107110
versions of Node.js.
108-
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
111+
As of now, that is Node.js 14.14+ and 16.0+.
109112
Our projects sometimes work with older versions, but this is not guaranteed.
110113

111114
## Security
@@ -182,10 +185,10 @@ abide by its terms.
182185

183186
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
184187

185-
[position-information]: https://github.com/syntax-tree/unist#positional-information
186-
187188
[mdast]: https://github.com/syntax-tree/mdast
188189

189190
[node]: https://github.com/syntax-tree/mdast#node
190191

191192
[hast]: https://github.com/syntax-tree/hast
193+
194+
[api-compact]: #compacttree

0 commit comments

Comments
 (0)