Skip to content

Commit 8b8004c

Browse files
committed
Add improved docs
1 parent 58e2218 commit 8b8004c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {visit} from 'unist-util-visit'
1818
* @param {Tree} tree
1919
* Tree to change.
2020
* @returns {Tree extends Paragraph ? Tree | null : Tree}
21-
* Changed tree, or `null` if it was an empty paragraph.
21+
* Changed `tree`, or `null` if it was an empty paragraph.
2222
*/
2323
export function squeezeParagraphs(tree) {
2424
if (emptyParagraph(tree)) {

readme.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ does the same but for [remark][].
4343
## Install
4444

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

4848
```sh
4949
npm install mdast-util-squeeze-paragraphs
@@ -91,27 +91,33 @@ Yields:
9191

9292
## API
9393

94-
This package exports the identifier `squeezeParagraphs`.
94+
This package exports the identifier
95+
[`squeezeParagraphs`][api-squeezeparagraphs].
9596
There is no default export.
9697

9798
### `squeezeParagraphs(tree)`
9899

99-
Remove empty paragraphs in `tree` ([`Node`][node]).
100+
Remove empty paragraphs in `tree`.
101+
102+
###### Parameters
103+
104+
* `tree` ([`Node`][node])
105+
— tree to change
100106

101107
###### Returns
102108

103-
The given `tree` ([`Node`][node]).
109+
Changed `tree` ([`Node`][node]), or `null` if it was an empty paragraph.
104110

105111
## Types
106112

107113
This package is fully typed with [TypeScript][].
108-
There are no additional types exported.
114+
It exports no additional types..
109115

110116
## Compatibility
111117

112118
Projects maintained by the unified collective are compatible with all maintained
113119
versions of Node.js.
114-
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
120+
As of now, that is Node.js 14.14+ and 16.0+.
115121
Our projects sometimes work with older versions, but this is not guaranteed.
116122

117123
## Security
@@ -197,3 +203,5 @@ abide by its terms.
197203
[remark]: https://github.com/remarkjs/remark
198204

199205
[remark-squeeze-paragraphs]: https://github.com/remarkjs/remark-squeeze-paragraphs
206+
207+
[api-squeezeparagraphs]: #squeezeparagraphstree

0 commit comments

Comments
 (0)