Skip to content

Commit f70934a

Browse files
committed
Refactor docs
1 parent fd0a325 commit f70934a

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

readme.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].
6868
## Install
6969

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

7373
```sh
7474
npm install mdast-util-gfm-table
@@ -103,15 +103,15 @@ Say our document `example.md` contains:
103103

104104
```js
105105
import fs from 'node:fs/promises'
106-
import {fromMarkdown} from 'mdast-util-from-markdown'
107-
import {toMarkdown} from 'mdast-util-to-markdown'
108106
import {gfmTable} from 'micromark-extension-gfm-table'
107+
import {fromMarkdown} from 'mdast-util-from-markdown'
109108
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
109+
import {toMarkdown} from 'mdast-util-to-markdown'
110110

111111
const doc = await fs.readFile('example.md')
112112

113113
const tree = fromMarkdown(doc, {
114-
extensions: [gfmTable],
114+
extensions: [gfmTable()],
115115
mdastExtensions: [gfmTableFromMarkdown]
116116
})
117117

@@ -220,10 +220,10 @@ It’s possible to align tables based on the visual width of cells.
220220
First, let’s show the problem:
221221

222222
```js
223-
import {fromMarkdown} from 'mdast-util-from-markdown'
224-
import {toMarkdown} from 'mdast-util-to-markdown'
225223
import {gfmTable} from 'micromark-extension-gfm-table'
224+
import {fromMarkdown} from 'mdast-util-from-markdown'
226225
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
226+
import {toMarkdown} from 'mdast-util-to-markdown'
227227

228228
const doc = `| Alpha | Bravo |
229229
| - | - |
@@ -254,16 +254,16 @@ One such algorithm is [`string-width`][string-width].
254254
It can be used like so:
255255

256256
```diff
257-
@@ -2,6 +2,7 @@ import {fromMarkdown} from 'mdast-util-from-markdown'
258-
import {toMarkdown} from 'mdast-util-to-markdown'
259-
import {gfmTable} from 'micromark-extension-gfm-table'
257+
@@ -2,6 +2,7 @@ import {gfmTable} from 'micromark-extension-gfm-table'
258+
import {fromMarkdown} from 'mdast-util-from-markdown'
260259
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
260+
import {toMarkdown} from 'mdast-util-to-markdown'
261261
+import stringWidth from 'string-width'
262262

263263
const doc = `| Alpha | Bravo |
264264
| - | - |
265265
@@ -13,4 +14,8 @@ const tree = fromMarkdown(doc, {
266-
mdastExtensions: [gfmTableFromMarkdown]
266+
mdastExtensions: [gfmTableFromMarkdown()]
267267
})
268268

269269
-console.log(toMarkdown(tree, {extensions: [gfmTableToMarkdown()]}))
@@ -409,7 +409,7 @@ For an example, see **[Table][dfn-table]**.
409409

410410
```idl
411411
enum alignType {
412-
"left" | "right" | "center" | null
412+
'center' | 'left' | 'right' | null
413413
}
414414
```
415415

@@ -458,12 +458,15 @@ from `@types/mdast`.
458458

459459
## Compatibility
460460

461-
Projects maintained by the unified collective are compatible with all maintained
461+
Projects maintained by the unified collective are compatible with maintained
462462
versions of Node.js.
463-
As of now, that is Node.js 14.14+ and 16.0+.
464-
Our projects sometimes work with older versions, but this is not guaranteed.
465463

466-
This plugin works with `mdast-util-from-markdown` version 1+ and
464+
When we cut a new major release, we drop support for unmaintained versions of
465+
Node.
466+
This means we try to keep the current release line, `mdast-util-gfm-table@^1`,
467+
compatible with Node.js 12.
468+
469+
This utility works with `mdast-util-from-markdown` version 1+ and
467470
`mdast-util-to-markdown` version 1+.
468471

469472
## Related
@@ -504,9 +507,9 @@ abide by its terms.
504507

505508
[downloads]: https://www.npmjs.com/package/mdast-util-gfm-table
506509

507-
[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-gfm-table.svg
510+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-table
508511

509-
[size]: https://bundlephobia.com/result?p=mdast-util-gfm-table
512+
[size]: https://bundlejs.com/?q=mdast-util-gfm-table
510513

511514
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
512515

0 commit comments

Comments
 (0)