Skip to content

Commit 87996c8

Browse files
committed
Refactor docs
1 parent 9a17e77 commit 87996c8

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

readme.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
[![Backers][backers-badge]][collective]
99
[![Chat][chat-badge]][chat]
1010

11-
[hast][] utility with equivalents for `querySelector`, `querySelectorAll`,
12-
and `matches`.
11+
[hast][] utility with equivalents for `matches`, `querySelector`,
12+
and `querySelectorAll`.
1313

1414
## Contents
1515

@@ -33,8 +33,8 @@ and `matches`.
3333

3434
## What is this?
3535

36-
This package lets you find nodes in a tree, similar to how `querySelector`,
37-
`querySelectorAll`, and `matches` work with the DOM.
36+
This package lets you find nodes in a tree, similar to how `matches`,
37+
`querySelector`, and `querySelectorAll` work with the DOM.
3838

3939
One notable difference between DOM and hast is that DOM nodes have references
4040
to their parents, meaning that `document.body.matches(':last-child')` can
@@ -56,7 +56,7 @@ find and match any unist node.
5656
## Install
5757

5858
This package is [ESM only][esm].
59-
In Node.js (version 14.14+ and 16.0+), install with [npm][]:
59+
In Node.js (version 16+), install with [npm][]:
6060

6161
```sh
6262
npm install hast-util-select
@@ -103,8 +103,8 @@ console.log(selectAll('h1 ~ :nth-child(even)', tree))
103103

104104
## API
105105

106-
This package exports the identifiers [`matches`][matches], [`select`][select],
107-
and [`selectAll`][selectall].
106+
This package exports the identifiers [`matches`][api-matches],
107+
[`select`][api-select], and [`selectAll`][api-select-all].
108108
There is no default export.
109109

110110
### `matches(selector, node[, space])`
@@ -122,7 +122,7 @@ This only checks that the given element matches the selector.
122122
— CSS selector, such as (`h1`, `a, b`)
123123
* `node` ([`Node`][node], optional)
124124
— node that might match `selector`, should be an element
125-
* `space` ([`Space`][space], default: `'html'`)
125+
* `space` ([`Space`][api-space], default: `'html'`)
126126
— name of namespace
127127

128128
###### Returns
@@ -155,7 +155,7 @@ Searches the tree in *[preorder][]*.
155155
— CSS selector, such as (`h1`, `a, b`)
156156
* `tree` ([`Node`][node], optional)
157157
— tree to search
158-
* `space` ([`Space`][space], default: `'html'`)
158+
* `space` ([`Space`][api-space], default: `'html'`)
159159
— name of namespace
160160

161161
###### Returns
@@ -203,7 +203,7 @@ Searches the tree in *[preorder][]*.
203203
— CSS selector, such as (`h1`, `a, b`)
204204
* `tree` ([`Node`][node], optional)
205205
— tree to search
206-
* `space` ([`Space`][space], default: `'html'`)
206+
* `space` ([`Space`][api-space], default: `'html'`)
207207
— name of namespace
208208

209209
###### Returns
@@ -276,8 +276,8 @@ type Space = 'html' | 'svg'
276276
* [x] `[attr*=value]` (attribute contains)
277277
* [x] `:dir()` (functional pseudo-class)
278278
* [x] `:has()` (functional pseudo-class)
279-
* [x] `:lang()` (functional pseudo-class)
280279
* [x] `:is()` (functional pseudo-class)
280+
* [x] `:lang()` (functional pseudo-class)
281281
* [x] `:not()` (functional pseudo-class)
282282
* [x] `:any-link` (pseudo-class)
283283
* [x] `:blank` (pseudo-class)
@@ -367,14 +367,17 @@ type Space = 'html' | 'svg'
367367
## Types
368368
369369
This package is fully typed with [TypeScript][].
370-
It exports the additional type [`Space`][space].
370+
It exports the additional type [`Space`][api-space].
371371
372372
## Compatibility
373373
374-
Projects maintained by the unified collective are compatible with all maintained
374+
Projects maintained by the unified collective are compatible with maintained
375375
versions of Node.js.
376-
As of now, that is Node.js 14.14+ and 16.0+.
377-
Our projects sometimes work with older versions, but this is not guaranteed.
376+
377+
When we cut a new major release, we drop support for unmaintained versions of
378+
Node.
379+
This means we try to keep the current release line, `hast-util-select@^5`,
380+
compatible with Node.js 12.
378381
379382
## Security
380383
@@ -420,9 +423,9 @@ abide by its terms.
420423
421424
[downloads]: https://www.npmjs.com/package/hast-util-select
422425
423-
[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-select.svg
426+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-select
424427
425-
[size]: https://bundlephobia.com/result?p=hast-util-select
428+
[size]: https://bundlejs.com/?q=hast-util-select
426429
427430
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
428431
@@ -466,10 +469,10 @@ abide by its terms.
466469
467470
[unist-util-select]: https://github.com/syntax-tree/unist-util-select
468471
469-
[matches]: #matchesselector-node-space
472+
[api-matches]: #matchesselector-node-space
470473
471-
[select]: #selectselector-tree-space
474+
[api-select]: #selectselector-tree-space
472475
473-
[selectall]: #selectallselector-tree-space
476+
[api-select-all]: #selectallselector-tree-space
474477
475-
[space]: #space
478+
[api-space]: #space

0 commit comments

Comments
 (0)