@@ -74,7 +74,7 @@ turning mdast (markdown) nodes into hast (HTML) nodes,
74
74
## Install
75
75
76
76
This package is [ ESM only] [ esm ] .
77
- In Node.js (version 14.14+ and 16.0 +), install with [ npm] [ ] :
77
+ In Node.js (version 16 +), install with [ npm] [ ] :
78
78
79
79
``` sh
80
80
npm install mdast-util-math
110
110
111
111
``` js
112
112
import fs from ' node:fs/promises'
113
- import {fromMarkdown } from ' mdast-util-from-markdown'
114
- import {toMarkdown } from ' mdast-util-to-markdown'
115
113
import {math } from ' micromark-extension-math'
114
+ import {fromMarkdown } from ' mdast-util-from-markdown'
116
115
import {mathFromMarkdown , mathToMarkdown } from ' mdast-util-math'
116
+ import {toMarkdown } from ' mdast-util-to-markdown'
117
117
118
118
const doc = await fs .readFile (' example.md' )
119
119
161
161
162
162
## API
163
163
164
- This package exports the identifiers [ ` mathFromMarkdown ` ] [ api-mathfrommarkdown ]
165
- and [ ` mathToMarkdown ` ] [ api-mathtomarkdown ] .
164
+ This package exports the identifiers
165
+ [ ` mathFromMarkdown ` ] [ api-math-from-markdown ]
166
+ and [ ` mathToMarkdown ` ] [ api-math-to-markdown ] .
166
167
There is no default export.
167
168
168
169
### ` mathFromMarkdown() `
@@ -172,21 +173,21 @@ Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown].
172
173
###### Returns
173
174
174
175
Extension for ` mdast-util-from-markdown `
175
- ([ ` FromMarkdownExtension ` ] [ frommarkdownextension ] ).
176
+ ([ ` FromMarkdownExtension ` ] [ from-markdown-extension ] ).
176
177
177
178
### ` mathToMarkdown(options?) `
178
179
179
180
Create an extension for [ ` mdast-util-to-markdown ` ] [ mdast-util-to-markdown ] .
180
181
181
182
###### Parameters
182
183
183
- * ` options ` ([ ` ToOptions ` ] [ api-tooptions ] , optional)
184
+ * ` options ` ([ ` ToOptions ` ] [ api-to-options ] , optional)
184
185
— configuration
185
186
186
187
###### Returns
187
188
188
189
Extension for ` mdast-util-to-markdown `
189
- ([ ` ToMarkdownExtension ` ] [ tomarkdownextension ] ).
190
+ ([ ` ToMarkdownExtension ` ] [ to-markdown-extension ] ).
190
191
191
192
### ` InlineMath `
192
193
@@ -250,7 +251,7 @@ The following interfaces are added to **[mdast][]** by this utility.
250
251
251
252
``` idl
252
253
interface Math <: Literal {
253
- type: " code"
254
+ type: ' code'
254
255
meta: string?
255
256
}
256
257
```
@@ -290,7 +291,7 @@ Yields:
290
291
291
292
``` idl
292
293
interface InlineMath <: Literal {
293
- type: " inlineMath"
294
+ type: ' inlineMath'
294
295
}
295
296
```
296
297
@@ -327,14 +328,14 @@ type FlowContentMath = Math | FlowContent
327
328
#### ` PhrasingContent ` (math)
328
329
329
330
``` idl
330
- type PhrasingMath = InlineMath | PhrasingContent
331
+ type PhrasingContentMath = InlineMath | PhrasingContent
331
332
```
332
333
333
334
## Types
334
335
335
336
This package is fully typed with [ TypeScript] [ ] .
336
- It exports the additional types [ ` InlineMath ` ] [ api-inlinemath ] ,
337
- [ ` Math ` ] [ api-math ] , and [ ` ToOptions ` ] [ api-tooptions ] .
337
+ It exports the additional types [ ` InlineMath ` ] [ api-inline-math ] ,
338
+ [ ` Math ` ] [ api-math ] , and [ ` ToOptions ` ] [ api-to-options ] .
338
339
339
340
It also registers the node types with ` @types/mdast ` .
340
341
If you’re working with the syntax tree, make sure to import this utility
@@ -357,10 +358,13 @@ visit(tree, function (node) {
357
358
358
359
## Compatibility
359
360
360
- Projects maintained by the unified collective are compatible with all maintained
361
+ Projects maintained by the unified collective are compatible with maintained
361
362
versions of Node.js.
362
- As of now, that is Node.js 14.14+ and 16.0+.
363
- Our projects sometimes work with older versions, but this is not guaranteed.
363
+
364
+ When we cut a new major release, we drop support for unmaintained versions of
365
+ Node.
366
+ This means we try to keep the current release line, ` mdast-util-math@^2 ` ,
367
+ compatible with Node.js 12.
364
368
365
369
This plugin works with ` mdast-util-from-markdown ` version 1+ and
366
370
` mdast-util-to-markdown ` version 1+.
@@ -400,9 +404,9 @@ abide by its terms.
400
404
401
405
[ downloads ] : https://www.npmjs.com/package/mdast-util-math
402
406
403
- [ size-badge ] : https://img.shields.io/bundlephobia/minzip/ mdast-util-math.svg
407
+ [ size-badge ] : https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q= mdast-util-math
404
408
405
- [ size ] : https://bundlephobia .com/result?p =mdast-util-math
409
+ [ size ] : https://bundlejs .com/?q =mdast-util-math
406
410
407
411
[ sponsors-badge ] : https://opencollective.com/unified/sponsors/badge.svg
408
412
@@ -454,19 +458,19 @@ abide by its terms.
454
458
455
459
[ dfn-literal ] : https://github.com/syntax-tree/mdast#literal
456
460
457
- [ frommarkdownextension ] : https://github.com/syntax-tree/mdast-util-from-markdown#extension
461
+ [ from-markdown-extension ] : https://github.com/syntax-tree/mdast-util-from-markdown#extension
458
462
459
- [ tomarkdownextension ] : https://github.com/syntax-tree/mdast-util-to-markdown#options
463
+ [ to-markdown-extension ] : https://github.com/syntax-tree/mdast-util-to-markdown#options
460
464
461
- [ api-mathfrommarkdown ] : #mathfrommarkdown
465
+ [ api-math-from-markdown ] : #mathfrommarkdown
462
466
463
- [ api-mathtomarkdown ] : #mathtomarkdownoptions
467
+ [ api-math-to-markdown ] : #mathtomarkdownoptions
464
468
465
469
[ api-math ] : #math
466
470
467
- [ api-inlinemath ] : #inlinemath
471
+ [ api-inline-math ] : #inlinemath
468
472
469
- [ api-tooptions ] : #tooptions
473
+ [ api-to-options ] : #tooptions
470
474
471
475
[ dfn-flow-content ] : #flowcontent-math
472
476
0 commit comments