Skip to content

Commit 82e6db4

Browse files
committed
Add improved docs
1 parent ab14525 commit 82e6db4

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

readme.md

Lines changed: 15 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-normalize-headings
@@ -95,27 +95,34 @@ Yields:
9595

9696
## API
9797

98-
This package exports the identifier `normalizeHeadings`.
98+
This package exports the identifier
99+
[`normalizeHeadings`][api-normalizeheadings].
99100
There is no default export.
100101

101102
### `normalizeHeadings(tree)`
102103

103-
Normalize heading depths.
104+
Make sure that there is only one top-level heading in the document by adjusting
105+
headings depths accordingly.
106+
107+
###### Parameters
108+
109+
* `tree` ([`Node`][node])
110+
— tree to change
104111

105112
###### Returns
106113

107-
The given `tree` ([`Node`][node]).
114+
Given, modified, `tree` ([`Node`][node]).
108115

109116
## Types
110117

111118
This package is fully typed with [TypeScript][].
112-
There are no additional exported types.
119+
It exports no additional types.
113120

114121
## Compatibility
115122

116123
Projects maintained by the unified collective are compatible with all maintained
117124
versions of Node.js.
118-
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
125+
As of now, that is Node.js 14.14+ and 16.0+.
119126
Our projects sometimes work with older versions, but this is not guaranteed.
120127

121128
## Security
@@ -199,3 +206,5 @@ abide by its terms.
199206
[remark]: https://github.com/remarkjs/remark
200207

201208
[remark-normalize-headings]: https://github.com/remarkjs/remark-normalize-headings
209+
210+
[api-normalizeheadings]: #normalizeheadingstree

0 commit comments

Comments
 (0)