Skip to content

Commit e161c69

Browse files
committed
Refactor docs
1 parent 7fdf3eb commit e161c69

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

readme.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ a lot when working with classes in the syntax tree.
4141
## Install
4242

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

4646
```sh
4747
npm install hast-util-classnames
@@ -76,7 +76,7 @@ console.log(classnames(node, 'bravo', ['charlie', {delta: false, echo: 1}]))
7676
Yields:
7777

7878
```js
79-
['123', 'alpha', 'charlie']
79+
['alpha', '123', 'charlie']
8080
{
8181
type: 'element',
8282
tagName: 'p',
@@ -87,7 +87,7 @@ Yields:
8787

8888
## API
8989

90-
This package exports the identifier [`classnames`][classnames].
90+
This package exports the identifier [`classnames`][api-classnames].
9191
There is no default export.
9292

9393
### `classnames([node, ]…conditionals)`
@@ -106,7 +106,7 @@ This function has two signatures, depending on whether a `node` was passed.
106106
* `node` ([`Node`][node])
107107
— optionally, node whose classes to append to (must be
108108
[`Element`][element])
109-
* `conditionals` ([`Array<Conditional>`][conditional])
109+
* `conditionals` ([`Array<Conditional>`][api-conditional])
110110
— class configuration to merge
111111

112112
###### Returns
@@ -155,16 +155,19 @@ type Conditional =
155155
## Types
156156
157157
This package is fully typed with [TypeScript][].
158-
It exports the additional types [`Conditional`][conditional],
159-
[`ConditionalMap`][conditionalmap], and
160-
[`ConditionalPrimitive`][conditionalprimitive].
158+
It exports the additional types [`Conditional`][api-conditional],
159+
[`ConditionalMap`][api-conditional-map], and
160+
[`ConditionalPrimitive`][api-conditional-primitive].
161161
162162
## Compatibility
163163
164-
Projects maintained by the unified collective are compatible with all maintained
164+
Projects maintained by the unified collective are compatible with maintained
165165
versions of Node.js.
166-
As of now, that is Node.js 14.14+ and 16.0+.
167-
Our projects sometimes work with older versions, but this is not guaranteed.
166+
167+
When we cut a new major release, we drop support for unmaintained versions of
168+
Node.
169+
This means we try to keep the current release line, `hast-util-classnames@^2`,
170+
compatible with Node.js 12.
168171
169172
## Security
170173
@@ -213,9 +216,9 @@ abide by its terms.
213216
214217
[downloads]: https://www.npmjs.com/package/hast-util-classnames
215218
216-
[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-classnames.svg
219+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=hast-util-classnames
217220
218-
[size]: https://bundlephobia.com/result?p=hast-util-classnames
221+
[size]: https://bundlejs.com/?q=hast-util-classnames
219222
220223
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
221224
@@ -255,10 +258,10 @@ abide by its terms.
255258
256259
[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize
257260
258-
[classnames]: #classnamesnode-conditionals
261+
[api-classnames]: #classnamesnode-conditionals
259262
260-
[conditional]: #conditional
263+
[api-conditional]: #conditional
261264
262-
[conditionalmap]: #conditionalmap
265+
[api-conditional-map]: #conditionalmap
263266
264-
[conditionalprimitive]: #conditionalprimitive
267+
[api-conditional-primitive]: #conditionalprimitive

0 commit comments

Comments
 (0)