Skip to content

Commit 2258889

Browse files
committed
Refactor docs
1 parent cf5bc8c commit 2258889

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

readme.md

+22-19
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ same at a higher-level (easier) abstraction.
4848
## Install
4949

5050
This package is [ESM only][esm].
51-
In Node.js (version 14.14+ and or 16.0+), install with [npm][]:
51+
In Node.js (version 16+), install with [npm][]:
5252

5353
```sh
5454
npm install hast-util-to-nlcst
@@ -57,14 +57,14 @@ npm install hast-util-to-nlcst
5757
In Deno with [`esm.sh`][esmsh]:
5858

5959
```js
60-
import {toNlcst} from "https://esm.sh/hast-util-to-nlcst@3"
60+
import {toNlcst} from 'https://esm.sh/hast-util-to-nlcst@3'
6161
```
6262

6363
In browsers with [`esm.sh`][esmsh]:
6464

6565
```html
6666
<script type="module">
67-
import {toNlcst} from "https://esm.sh/hast-util-to-nlcst@3?bundle"
67+
import {toNlcst} from 'https://esm.sh/hast-util-to-nlcst@3?bundle'
6868
</script>
6969
```
7070

@@ -83,11 +83,11 @@ Say our document `example.html` contains:
8383
…and our module `example.js` looks as follows:
8484

8585
```js
86-
import {read} from 'to-vfile'
87-
import {inspect} from 'unist-util-inspect'
88-
import {toNlcst} from 'hast-util-to-nlcst'
8986
import {fromHtml} from 'hast-util-from-html'
87+
import {toNlcst} from 'hast-util-to-nlcst'
9088
import {ParseEnglish} from 'parse-english'
89+
import {read} from 'to-vfile'
90+
import {inspect} from 'unist-util-inspect'
9191

9292
const file = await read('example.html')
9393
const tree = fromHtml(file)
@@ -121,7 +121,7 @@ RootNode[2] (1:1-6:1, 0-134)
121121

122122
## API
123123

124-
This package exports the identifier [`toNlcst`][tonlcst].
124+
This package exports the identifier [`toNlcst`][api-to-nlcst].
125125
There is no default export.
126126

127127
### `toNlcst(tree, file, Parser)`
@@ -137,8 +137,8 @@ Turn a hast tree into an nlcst tree.
137137
— hast tree to transform
138138
* `file` ([`VFile`][vfile])
139139
— virtual file
140-
* `Parser` ([`ParserConstructor`][parserconstructor] or
141-
[`ParserInstance`][parserinstance])
140+
* `Parser` ([`ParserConstructor`][api-parser-constructor] or
141+
[`ParserInstance`][api-parser-instance])
142142
— parser to use.
143143

144144
##### Returns
@@ -218,15 +218,18 @@ type ParserInstance = {
218218
## Types
219219
220220
This package is fully typed with [TypeScript][].
221-
It exports the additional types [`ParserConstructor`][parserconstructor] and
222-
[`ParserInstance`][parserinstance].
221+
It exports the additional types [`ParserConstructor`][api-parser-constructor]
222+
and [`ParserInstance`][api-parser-instance].
223223
224224
## Compatibility
225225
226-
Projects maintained by the unified collective are compatible with all maintained
226+
Projects maintained by the unified collective are compatible with maintained
227227
versions of Node.js.
228-
As of now, that is Node.js 14.14+ and 16.0+.
229-
Our projects sometimes work with older versions, but this is not guaranteed.
228+
229+
When we cut a new major release, we drop support for unmaintained versions of
230+
Node.
231+
This means we try to keep the current release line, `hast-util-to-nlcst@^3`,
232+
compatible with Node.js 12.
230233
231234
## Security
232235
@@ -270,9 +273,9 @@ abide by its terms.
270273
271274
[downloads]: https://www.npmjs.com/package/hast-util-to-nlcst
272275
273-
[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-to-nlcst.svg
276+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-to-nlcst
274277
275-
[size]: https://bundlephobia.com/result?p=hast-util-to-nlcst
278+
[size]: https://bundlejs.com/?q=hast-util-to-nlcst
276279
277280
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
278281
@@ -328,8 +331,8 @@ abide by its terms.
328331
329332
[parse-dutch]: https://github.com/wooorm/parse-dutch
330333
331-
[tonlcst]: #tonlcsttree-file-parser
334+
[api-to-nlcst]: #tonlcsttree-file-parser
332335
333-
[parserconstructor]: #parserconstructor
336+
[api-parser-constructor]: #parserconstructor
334337
335-
[parserinstance]: #parserinstance
338+
[api-parser-instance]: #parserinstance

0 commit comments

Comments
 (0)