Skip to content

Commit 8ea3942

Browse files
committed
Refactor docs
1 parent 379dd6f commit 8ea3942

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

readme.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ internals away.
6969
## Install
7070

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

7474
```sh
7575
npm install mdast-util-frontmatter
@@ -105,10 +105,10 @@ title = "New Website"
105105

106106
```js
107107
import fs from 'node:fs/promises'
108-
import {fromMarkdown} from 'mdast-util-from-markdown'
109-
import {toMarkdown} from 'mdast-util-to-markdown'
110108
import {frontmatter} from 'micromark-extension-frontmatter'
109+
import {fromMarkdown} from 'mdast-util-from-markdown'
111110
import {frontmatterFromMarkdown, frontmatterToMarkdown} from 'mdast-util-frontmatter'
111+
import {toMarkdown} from 'mdast-util-to-markdown'
112112

113113
const doc = await fs.readFile('example.md')
114114

@@ -151,8 +151,8 @@ title = "New Website"
151151
## API
152152

153153
This package exports the identifiers
154-
[`frontmatterFromMarkdown`][api-frontmatterfrommarkdown] and
155-
[`frontmatterToMarkdown`][api-frontmattertomarkdown].
154+
[`frontmatterFromMarkdown`][api-frontmatter-from-markdown] and
155+
[`frontmatterToMarkdown`][api-frontmatter-to-markdown].
156156
There is no default export.
157157

158158
### `frontmatterFromMarkdown(options?)`
@@ -168,7 +168,7 @@ Create an extension for
168168
###### Returns
169169

170170
Extension for `mdast-util-from-markdown`
171-
([`FromMarkdownExtension`][frommarkdownextension]).
171+
([`FromMarkdownExtension`][from-markdown-extension]).
172172

173173
### `frontmatterToMarkdown(options?)`
174174

@@ -183,27 +183,25 @@ Create an extension for
183183
###### Returns
184184

185185
Extension for `mdast-util-to-markdown`
186-
([`ToMarkdownExtension`][tomarkdownextension]).
186+
([`ToMarkdownExtension`][to-markdown-extension]).
187187

188188
### `Info`
189189

190190
Structure of marker or fence (TypeScript type).
191191

192-
<!-- To do: fix link when `info` is documented -->
193-
194-
Same as [`Info` from `micromark-extension-frontmatter`][matter].
192+
Same as [`Info` from `micromark-extension-frontmatter`][micromark-info].
195193

196194
### `Matter`
197195

198196
Structure of matter (TypeScript type).
199197

200-
Same as [`Matter` from `micromark-extension-frontmatter`][matter].
198+
Same as [`Matter` from `micromark-extension-frontmatter`][micromark-matter].
201199

202200
### `Options`
203201

204202
Configuration (TypeScript type).
205203

206-
Same as [`Options` from `micromark-extension-frontmatter`][options].
204+
Same as [`Options` from `micromark-extension-frontmatter`][micromark-options].
207205

208206
## Syntax
209207

@@ -293,12 +291,15 @@ declare module 'mdast' {
293291

294292
## Compatibility
295293

296-
Projects maintained by the unified collective are compatible with all maintained
294+
Projects maintained by the unified collective are compatible with maintained
297295
versions of Node.js.
298-
As of now, that is Node.js 14.14+ and 16.0+.
299-
Our projects sometimes work with older versions, but this is not guaranteed.
300296

301-
These extensions works with `mdast-util-from-markdown` version 1+ and
297+
When we cut a new major release, we drop support for unmaintained versions of
298+
Node.
299+
This means we try to keep the current release line,
300+
`mdast-util-frontmatter@^1`, compatible with Node.js 12.
301+
302+
This utility works with `mdast-util-from-markdown` version 1+ and
302303
`mdast-util-to-markdown` version 1+.
303304

304305
## Related
@@ -336,9 +337,9 @@ abide by its terms.
336337

337338
[downloads]: https://www.npmjs.com/package/mdast-util-frontmatter
338339

339-
[size-badge]: https://img.shields.io/bundlephobia/minzip/mdast-util-frontmatter.svg
340+
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-frontmatter
340341

341-
[size]: https://bundlephobia.com/result?p=mdast-util-frontmatter
342+
[size]: https://bundlejs.com/?q=mdast-util-frontmatter
342343

343344
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
344345

@@ -382,9 +383,11 @@ abide by its terms.
382383

383384
[micromark-extension-frontmatter]: https://github.com/micromark/micromark-extension-frontmatter
384385

385-
[options]: https://github.com/micromark/micromark-extension-frontmatter#options
386+
[micromark-info]: https://github.com/micromark/micromark-extension-frontmatter#info
387+
388+
[micromark-matter]: https://github.com/micromark/micromark-extension-frontmatter#matter
386389

387-
[matter]: https://github.com/micromark/micromark-extension-frontmatter#matter
390+
[micromark-options]: https://github.com/micromark/micromark-extension-frontmatter#options
388391

389392
[syntax]: https://github.com/micromark/micromark-extension-frontmatter#syntax
390393

@@ -394,15 +397,15 @@ abide by its terms.
394397

395398
[term-head]: https://github.com/syntax-tree/unist#head
396399

397-
[frommarkdownextension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension
400+
[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension
398401

399-
[tomarkdownextension]: https://github.com/syntax-tree/mdast-util-to-markdown#options
402+
[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options
400403

401404
[dfn-frontmatter-content]: #frontmattercontent
402405

403-
[api-frontmatterfrommarkdown]: #frontmatterfrommarkdownoptions
406+
[api-frontmatter-from-markdown]: #frontmatterfrommarkdownoptions
404407

405-
[api-frontmattertomarkdown]: #frontmattertomarkdownoptions
408+
[api-frontmatter-to-markdown]: #frontmattertomarkdownoptions
406409

407410
[api-info]: #info
408411

0 commit comments

Comments
 (0)