@isdk/mdast-plus 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.cn.md +22 -9
- package/README.md +17 -4
- package/dist/index.d.mts +394 -83
- package/dist/index.d.ts +394 -83
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +17 -4
- package/docs/_media/CONTRIBUTING.md +21 -13
- package/docs/_media/README.cn.md +22 -9
- package/docs/classes/MdastBasePipeline.md +96 -28
- package/docs/classes/MdastPipeline.md +116 -36
- package/docs/enumerations/PipelineStage.md +6 -6
- package/docs/functions/astCompiler.md +1 -1
- package/docs/functions/jsonParser.md +1 -1
- package/docs/functions/mdast.md +1 -1
- package/docs/globals.md +5 -0
- package/docs/interfaces/MdastDataOrigin.md +4 -4
- package/docs/interfaces/MdastFormat.md +7 -7
- package/docs/interfaces/MdastMark.md +3 -3
- package/docs/interfaces/MdastPlugin.md +38 -6
- package/docs/interfaces/MdastSub.md +3 -3
- package/docs/interfaces/MdastSup.md +3 -3
- package/docs/interfaces/ReadabilityOptions.md +33 -0
- package/docs/type-aliases/PipelineStageName.md +1 -1
- package/docs/variables/DefaultPipelineStage.md +1 -1
- package/docs/variables/astFormat.md +1 -1
- package/docs/variables/htmlFormat.md +1 -1
- package/docs/variables/htmlReadability.md +13 -0
- package/docs/variables/htmlReadabilityPlugin.md +27 -0
- package/docs/variables/htmlReadabilityPlugins.md +13 -0
- package/docs/variables/markdownFormat.md +1 -1
- package/docs/variables/restoreReadabilityMetaPlugin.md +49 -0
- package/package.json +8 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: MdastPipeline
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:399](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L399)
|
|
10
10
|
|
|
11
11
|
Extended pipeline with convenience methods for common formats.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Extended pipeline with convenience methods for common formats.
|
|
|
20
20
|
|
|
21
21
|
> **new MdastPipeline**(`input`): `MdastPipeline`
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
23
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:54](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L54)
|
|
24
24
|
|
|
25
25
|
Initializes a new pipeline instance with the given input.
|
|
26
26
|
|
|
@@ -42,11 +42,23 @@ Content to process (string, Buffer, VFile, or AST Node).
|
|
|
42
42
|
|
|
43
43
|
## Properties
|
|
44
44
|
|
|
45
|
+
### \_data
|
|
46
|
+
|
|
47
|
+
> `protected` **\_data**: `Record`\<`string`, `any`\> = `{}`
|
|
48
|
+
|
|
49
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:48](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L48)
|
|
50
|
+
|
|
51
|
+
#### Inherited from
|
|
52
|
+
|
|
53
|
+
[`MdastBasePipeline`](MdastBasePipeline.md).[`_data`](MdastBasePipeline.md#_data)
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
45
57
|
### input
|
|
46
58
|
|
|
47
59
|
> `protected` **input**: `Compatible`
|
|
48
60
|
|
|
49
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:46](https://github.com/isdk/mdast-plus.js/blob/
|
|
61
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:46](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L46)
|
|
50
62
|
|
|
51
63
|
#### Inherited from
|
|
52
64
|
|
|
@@ -58,7 +70,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:46](https://github.com/isdk/mda
|
|
|
58
70
|
|
|
59
71
|
> `protected` **queue**: [`MdastPlugin`](../interfaces/MdastPlugin.md)[] = `[]`
|
|
60
72
|
|
|
61
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:47](https://github.com/isdk/mdast-plus.js/blob/
|
|
73
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:47](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L47)
|
|
62
74
|
|
|
63
75
|
#### Inherited from
|
|
64
76
|
|
|
@@ -70,7 +82,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:47](https://github.com/isdk/mda
|
|
|
70
82
|
|
|
71
83
|
> `protected` **assembleProcessor**(`queue`): `Processor`
|
|
72
84
|
|
|
73
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
85
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:326](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L326)
|
|
74
86
|
|
|
75
87
|
Assembles a unified processor based on the sorted plugin queue.
|
|
76
88
|
|
|
@@ -90,11 +102,45 @@ Assembles a unified processor based on the sorted plugin queue.
|
|
|
90
102
|
|
|
91
103
|
***
|
|
92
104
|
|
|
105
|
+
### data()
|
|
106
|
+
|
|
107
|
+
> **data**(`key`, `value?`): `this`
|
|
108
|
+
|
|
109
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L64)
|
|
110
|
+
|
|
111
|
+
Configures global data for the pipeline, which will be available to all plugins via this.data().
|
|
112
|
+
|
|
113
|
+
#### Parameters
|
|
114
|
+
|
|
115
|
+
##### key
|
|
116
|
+
|
|
117
|
+
Data key or a record of multiple data entries.
|
|
118
|
+
|
|
119
|
+
`string` | `Record`\<`string`, `any`\>
|
|
120
|
+
|
|
121
|
+
##### value?
|
|
122
|
+
|
|
123
|
+
`any`
|
|
124
|
+
|
|
125
|
+
Value to set (if key is a string).
|
|
126
|
+
|
|
127
|
+
#### Returns
|
|
128
|
+
|
|
129
|
+
`this`
|
|
130
|
+
|
|
131
|
+
The pipeline instance for chaining.
|
|
132
|
+
|
|
133
|
+
#### Inherited from
|
|
134
|
+
|
|
135
|
+
[`MdastBasePipeline`](MdastBasePipeline.md).[`data`](MdastBasePipeline.md#data)
|
|
136
|
+
|
|
137
|
+
***
|
|
138
|
+
|
|
93
139
|
### ensureInputPlugins()
|
|
94
140
|
|
|
95
141
|
> `protected` **ensureInputPlugins**(`queue`, `overrides?`, `maxStage?`): `void`
|
|
96
142
|
|
|
97
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
143
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:149](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L149)
|
|
98
144
|
|
|
99
145
|
Ensures that input plugins (parser, normalizers) are present in the queue.
|
|
100
146
|
Adds implicit plugins if no parser is detected.
|
|
@@ -127,7 +173,7 @@ Adds implicit plugins if no parser is detected.
|
|
|
127
173
|
|
|
128
174
|
> **from**(`fmt`, `overrides?`): `this`
|
|
129
175
|
|
|
130
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
176
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:178](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L178)
|
|
131
177
|
|
|
132
178
|
Configures the input format and adds its associated plugins to the pipeline.
|
|
133
179
|
|
|
@@ -161,7 +207,7 @@ The pipeline instance for chaining.
|
|
|
161
207
|
|
|
162
208
|
> **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
163
209
|
|
|
164
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
210
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:76](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L76)
|
|
165
211
|
|
|
166
212
|
Instance-level access to the global format registry.
|
|
167
213
|
|
|
@@ -185,7 +231,7 @@ Instance-level access to the global format registry.
|
|
|
185
231
|
|
|
186
232
|
> **priority**(`order`): `this`
|
|
187
233
|
|
|
188
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
234
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:314](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L314)
|
|
189
235
|
|
|
190
236
|
Sets the priority order for the most recently added plugin.
|
|
191
237
|
Plugins with lower order run earlier within the same stage.
|
|
@@ -214,7 +260,7 @@ The pipeline instance for chaining.
|
|
|
214
260
|
|
|
215
261
|
> **to**(`fmt`, `overrides?`): `Promise`\<`VFile`\>
|
|
216
262
|
|
|
217
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
263
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:198](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L198)
|
|
218
264
|
|
|
219
265
|
Processes the pipeline and serializes the result into the specified format.
|
|
220
266
|
|
|
@@ -248,7 +294,7 @@ A promise resolving to a VFile containing the result.
|
|
|
248
294
|
|
|
249
295
|
> **toAst**(`options?`): `Promise`\<`Root`\>
|
|
250
296
|
|
|
251
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
297
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:436](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L436)
|
|
252
298
|
|
|
253
299
|
Finalizes the pipeline and returns the resulting AST (Root node).
|
|
254
300
|
|
|
@@ -280,7 +326,7 @@ Run the pipeline up to this stage only.
|
|
|
280
326
|
|
|
281
327
|
> **toAST**(`options?`): `Promise`\<`Root`\>
|
|
282
328
|
|
|
283
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
329
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:474](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L474)
|
|
284
330
|
|
|
285
331
|
Alias for toAst()
|
|
286
332
|
|
|
@@ -306,7 +352,7 @@ Alias for toAst()
|
|
|
306
352
|
|
|
307
353
|
> **toHtml**(): `Promise`\<`string`\>
|
|
308
354
|
|
|
309
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
355
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:418](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L418)
|
|
310
356
|
|
|
311
357
|
Finalizes the pipeline and returns the result as an HTML string.
|
|
312
358
|
|
|
@@ -320,7 +366,7 @@ Finalizes the pipeline and returns the result as an HTML string.
|
|
|
320
366
|
|
|
321
367
|
> **toHTML**(): `Promise`\<`string`\>
|
|
322
368
|
|
|
323
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
369
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:472](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L472)
|
|
324
370
|
|
|
325
371
|
Alias for toHtml()
|
|
326
372
|
|
|
@@ -334,7 +380,7 @@ Alias for toHtml()
|
|
|
334
380
|
|
|
335
381
|
> **toHtmlVFile**(): `Promise`\<`VFile`\>
|
|
336
382
|
|
|
337
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
383
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:426](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L426)
|
|
338
384
|
|
|
339
385
|
Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
340
386
|
|
|
@@ -348,7 +394,7 @@ Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
|
348
394
|
|
|
349
395
|
> **toMarkdown**(): `Promise`\<`string`\>
|
|
350
396
|
|
|
351
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
397
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:403](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L403)
|
|
352
398
|
|
|
353
399
|
Finalizes the pipeline and returns the result as a Markdown string.
|
|
354
400
|
|
|
@@ -362,7 +408,7 @@ Finalizes the pipeline and returns the result as a Markdown string.
|
|
|
362
408
|
|
|
363
409
|
> **toMarkdownVFile**(): `Promise`\<`VFile`\>
|
|
364
410
|
|
|
365
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
411
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:411](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L411)
|
|
366
412
|
|
|
367
413
|
Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
368
414
|
|
|
@@ -376,7 +422,7 @@ Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
|
376
422
|
|
|
377
423
|
> `protected` **toRuntimeEntry**(`entry`, `defaultStage`, `overrides?`): [`MdastPlugin`](../interfaces/MdastPlugin.md) & `object`
|
|
378
424
|
|
|
379
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
425
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:100](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L100)
|
|
380
426
|
|
|
381
427
|
Normalizes a plugin entry for runtime execution.
|
|
382
428
|
|
|
@@ -408,23 +454,23 @@ Normalizes a plugin entry for runtime execution.
|
|
|
408
454
|
|
|
409
455
|
> **use**(`plugin`, ...`options`): `this`
|
|
410
456
|
|
|
411
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
457
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:241](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L241)
|
|
412
458
|
|
|
413
|
-
Adds a plugin to the pipeline's compile stage.
|
|
459
|
+
Adds a plugin or an array of plugins to the pipeline's compile stage.
|
|
414
460
|
|
|
415
461
|
#### Parameters
|
|
416
462
|
|
|
417
463
|
##### plugin
|
|
418
464
|
|
|
419
|
-
|
|
465
|
+
The unified plugin function, a MdastPlugin object, or an array of them.
|
|
420
466
|
|
|
421
|
-
|
|
467
|
+
[`MdastPlugin`](../interfaces/MdastPlugin.md) | `Plugin` | ([`MdastPlugin`](../interfaces/MdastPlugin.md) \| `Plugin`)[]
|
|
422
468
|
|
|
423
469
|
##### options
|
|
424
470
|
|
|
425
471
|
...`any`[]
|
|
426
472
|
|
|
427
|
-
Arguments for the plugin.
|
|
473
|
+
Arguments for the plugin(s).
|
|
428
474
|
|
|
429
475
|
#### Returns
|
|
430
476
|
|
|
@@ -440,39 +486,73 @@ The pipeline instance for chaining.
|
|
|
440
486
|
|
|
441
487
|
### useAt()
|
|
442
488
|
|
|
489
|
+
#### Call Signature
|
|
490
|
+
|
|
443
491
|
> **useAt**(`stage`, `plugin`, ...`options`): `this`
|
|
444
492
|
|
|
445
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
493
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:252](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L252)
|
|
446
494
|
|
|
447
|
-
Adds a plugin to the pipeline at a specific stage.
|
|
495
|
+
Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
448
496
|
|
|
449
|
-
|
|
497
|
+
##### Parameters
|
|
450
498
|
|
|
451
|
-
|
|
499
|
+
###### stage
|
|
452
500
|
|
|
453
501
|
The stage name or numeric value.
|
|
454
502
|
|
|
455
503
|
`"parse"` | `"normalize"` | `"compile"` | `"finalize"` | `"stringify"`
|
|
456
504
|
|
|
457
|
-
|
|
505
|
+
###### plugin
|
|
458
506
|
|
|
459
|
-
|
|
507
|
+
The unified plugin function, a MdastPlugin object, or an array of them.
|
|
460
508
|
|
|
461
|
-
|
|
509
|
+
[`MdastPlugin`](../interfaces/MdastPlugin.md) | `Plugin` | ([`MdastPlugin`](../interfaces/MdastPlugin.md) \| `Plugin`)[]
|
|
462
510
|
|
|
463
|
-
|
|
511
|
+
###### options
|
|
464
512
|
|
|
465
513
|
...`any`[]
|
|
466
514
|
|
|
467
|
-
Arguments for the plugin.
|
|
515
|
+
Arguments for the plugin(s).
|
|
468
516
|
|
|
469
|
-
|
|
517
|
+
##### Returns
|
|
470
518
|
|
|
471
519
|
`this`
|
|
472
520
|
|
|
473
521
|
The pipeline instance for chaining.
|
|
474
522
|
|
|
475
|
-
|
|
523
|
+
##### Inherited from
|
|
524
|
+
|
|
525
|
+
[`MdastBasePipeline`](MdastBasePipeline.md).[`useAt`](MdastBasePipeline.md#useat)
|
|
526
|
+
|
|
527
|
+
#### Call Signature
|
|
528
|
+
|
|
529
|
+
> **useAt**(`plugin`, ...`options`): `this`
|
|
530
|
+
|
|
531
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:259](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L259)
|
|
532
|
+
|
|
533
|
+
Adds a plugin or an array of plugins to the pipeline. The stage is taken from the plugin object(s).
|
|
534
|
+
|
|
535
|
+
##### Parameters
|
|
536
|
+
|
|
537
|
+
###### plugin
|
|
538
|
+
|
|
539
|
+
The MdastPlugin object or an array of them.
|
|
540
|
+
|
|
541
|
+
[`MdastPlugin`](../interfaces/MdastPlugin.md) | ([`MdastPlugin`](../interfaces/MdastPlugin.md) \| `Plugin`)[]
|
|
542
|
+
|
|
543
|
+
###### options
|
|
544
|
+
|
|
545
|
+
...`any`[]
|
|
546
|
+
|
|
547
|
+
Arguments for the plugin(s) (overrides plugin.options if provided).
|
|
548
|
+
|
|
549
|
+
##### Returns
|
|
550
|
+
|
|
551
|
+
`this`
|
|
552
|
+
|
|
553
|
+
The pipeline instance for chaining.
|
|
554
|
+
|
|
555
|
+
##### Inherited from
|
|
476
556
|
|
|
477
557
|
[`MdastBasePipeline`](MdastBasePipeline.md).[`useAt`](MdastBasePipeline.md#useat)
|
|
478
558
|
|
|
@@ -482,7 +562,7 @@ The pipeline instance for chaining.
|
|
|
482
562
|
|
|
483
563
|
> `static` **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
484
564
|
|
|
485
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/
|
|
565
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L42)
|
|
486
566
|
|
|
487
567
|
Retrieves a registered format by its ID.
|
|
488
568
|
|
|
@@ -510,7 +590,7 @@ The format definition or undefined if not found.
|
|
|
510
590
|
|
|
511
591
|
> `static` **register**(`format`): `void`
|
|
512
592
|
|
|
513
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:33](https://github.com/isdk/mdast-plus.js/blob/
|
|
593
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:33](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L33)
|
|
514
594
|
|
|
515
595
|
Registers a global document format.
|
|
516
596
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Enumeration: PipelineStage
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:10](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:10](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L10)
|
|
10
10
|
|
|
11
11
|
PipelineStage defines the execution order of plugins in the processing pipeline.
|
|
12
12
|
Plugins are sorted and executed in ascending order based on these stage values.
|
|
@@ -17,7 +17,7 @@ Plugins are sorted and executed in ascending order based on these stage values.
|
|
|
17
17
|
|
|
18
18
|
> **compile**: `200`
|
|
19
19
|
|
|
20
|
-
Defined in: [packages/mdast-plus/src/types.ts:16](https://github.com/isdk/mdast-plus.js/blob/
|
|
20
|
+
Defined in: [packages/mdast-plus/src/types.ts:16](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L16)
|
|
21
21
|
|
|
22
22
|
Transformation stage for semantic changes and custom high-level logic.
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ Transformation stage for semantic changes and custom high-level logic.
|
|
|
27
27
|
|
|
28
28
|
> **finalize**: `300`
|
|
29
29
|
|
|
30
|
-
Defined in: [packages/mdast-plus/src/types.ts:18](https://github.com/isdk/mdast-plus.js/blob/
|
|
30
|
+
Defined in: [packages/mdast-plus/src/types.ts:18](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L18)
|
|
31
31
|
|
|
32
32
|
Finalization stage for preparing the AST for output (e.g., Sanitize, bridge to HAST).
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Finalization stage for preparing the AST for output (e.g., Sanitize, bridge to H
|
|
|
37
37
|
|
|
38
38
|
> **normalize**: `100`
|
|
39
39
|
|
|
40
|
-
Defined in: [packages/mdast-plus/src/types.ts:14](https://github.com/isdk/mdast-plus.js/blob/
|
|
40
|
+
Defined in: [packages/mdast-plus/src/types.ts:14](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L14)
|
|
41
41
|
|
|
42
42
|
Normalization stage for cleaning up and canonicalizing the AST (e.g., GFM, Directives).
|
|
43
43
|
|
|
@@ -47,7 +47,7 @@ Normalization stage for cleaning up and canonicalizing the AST (e.g., GFM, Direc
|
|
|
47
47
|
|
|
48
48
|
> **parse**: `0`
|
|
49
49
|
|
|
50
|
-
Defined in: [packages/mdast-plus/src/types.ts:12](https://github.com/isdk/mdast-plus.js/blob/
|
|
50
|
+
Defined in: [packages/mdast-plus/src/types.ts:12](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L12)
|
|
51
51
|
|
|
52
52
|
Initial stage for parsing raw input (e.g., string to AST).
|
|
53
53
|
|
|
@@ -57,6 +57,6 @@ Initial stage for parsing raw input (e.g., string to AST).
|
|
|
57
57
|
|
|
58
58
|
> **stringify**: `400`
|
|
59
59
|
|
|
60
|
-
Defined in: [packages/mdast-plus/src/types.ts:20](https://github.com/isdk/mdast-plus.js/blob/
|
|
60
|
+
Defined in: [packages/mdast-plus/src/types.ts:20](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L20)
|
|
61
61
|
|
|
62
62
|
Final stage for serializing the AST to the target format result.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **astCompiler**(`this`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/ast.ts:16](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/ast.ts:16](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/formats/ast.ts#L16)
|
|
12
12
|
|
|
13
13
|
Pass-through compiler that returns the AST as-is.
|
|
14
14
|
Essential for unified processes that should output an object (the AST)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **jsonParser**(`this`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/ast.ts:24](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/ast.ts:24](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/formats/ast.ts#L24)
|
|
12
12
|
|
|
13
13
|
Parser for stringified JSON AST input.
|
|
14
14
|
Allows the pipeline to accept a JSON string and treat it as a unist tree.
|
package/docs/functions/mdast.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **mdast**(`input`): [`MdastPipeline`](../classes/MdastPipeline.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:486](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L486)
|
|
12
12
|
|
|
13
13
|
Entry point for the fluent mdast-plus API.
|
|
14
14
|
|
package/docs/globals.md
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
- [MdastPlugin](interfaces/MdastPlugin.md)
|
|
22
22
|
- [MdastSub](interfaces/MdastSub.md)
|
|
23
23
|
- [MdastSup](interfaces/MdastSup.md)
|
|
24
|
+
- [ReadabilityOptions](interfaces/ReadabilityOptions.md)
|
|
24
25
|
|
|
25
26
|
## Type Aliases
|
|
26
27
|
|
|
@@ -31,7 +32,11 @@
|
|
|
31
32
|
- [astFormat](variables/astFormat.md)
|
|
32
33
|
- [DefaultPipelineStage](variables/DefaultPipelineStage.md)
|
|
33
34
|
- [htmlFormat](variables/htmlFormat.md)
|
|
35
|
+
- [htmlReadability](variables/htmlReadability.md)
|
|
36
|
+
- [htmlReadabilityPlugin](variables/htmlReadabilityPlugin.md)
|
|
37
|
+
- [htmlReadabilityPlugins](variables/htmlReadabilityPlugins.md)
|
|
34
38
|
- [markdownFormat](variables/markdownFormat.md)
|
|
39
|
+
- [restoreReadabilityMetaPlugin](variables/restoreReadabilityMetaPlugin.md)
|
|
35
40
|
|
|
36
41
|
## Functions
|
|
37
42
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastDataOrigin
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:86](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L86)
|
|
10
10
|
|
|
11
11
|
Metadata capturing the origin of a node during conversion.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Metadata capturing the origin of a node during conversion.
|
|
|
20
20
|
|
|
21
21
|
> **format**: `string`
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:88](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L88)
|
|
24
24
|
|
|
25
25
|
The original source format.
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ The original source format.
|
|
|
30
30
|
|
|
31
31
|
> `optional` **hash**: `string`
|
|
32
32
|
|
|
33
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
33
|
+
Defined in: [packages/mdast-plus/src/types.ts:92](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L92)
|
|
34
34
|
|
|
35
35
|
Hash used for caching or change detection.
|
|
36
36
|
|
|
@@ -40,6 +40,6 @@ Hash used for caching or change detection.
|
|
|
40
40
|
|
|
41
41
|
> `optional` **raw**: `unknown`
|
|
42
42
|
|
|
43
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
43
|
+
Defined in: [packages/mdast-plus/src/types.ts:90](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L90)
|
|
44
44
|
|
|
45
45
|
The raw content from the source before conversion.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastFormat
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:66](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L66)
|
|
10
10
|
|
|
11
11
|
Defines a document format, encompassing its input (parsing) and output (serialization) strategies.
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Defines a document format, encompassing its input (parsing) and output (serializ
|
|
|
16
16
|
|
|
17
17
|
> `optional` **extensions**: `string`[]
|
|
18
18
|
|
|
19
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
19
|
+
Defined in: [packages/mdast-plus/src/types.ts:72](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L72)
|
|
20
20
|
|
|
21
21
|
File extensions associated with this format.
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ File extensions associated with this format.
|
|
|
26
26
|
|
|
27
27
|
> **id**: `string`
|
|
28
28
|
|
|
29
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
29
|
+
Defined in: [packages/mdast-plus/src/types.ts:68](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L68)
|
|
30
30
|
|
|
31
31
|
Unique identifier for the format (e.g., 'markdown', 'html').
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ Unique identifier for the format (e.g., 'markdown', 'html').
|
|
|
36
36
|
|
|
37
37
|
> `optional` **input**: [`MdastPlugin`](MdastPlugin.md)[]
|
|
38
38
|
|
|
39
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
39
|
+
Defined in: [packages/mdast-plus/src/types.ts:77](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L77)
|
|
40
40
|
|
|
41
41
|
Plugins used for reading this format into a standard AST (Parser + Normalizer).
|
|
42
42
|
|
|
@@ -46,7 +46,7 @@ Plugins used for reading this format into a standard AST (Parser + Normalizer).
|
|
|
46
46
|
|
|
47
47
|
> `optional` **mediaTypes**: `string`[]
|
|
48
48
|
|
|
49
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
49
|
+
Defined in: [packages/mdast-plus/src/types.ts:74](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L74)
|
|
50
50
|
|
|
51
51
|
MIME types associated with this format.
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@ MIME types associated with this format.
|
|
|
56
56
|
|
|
57
57
|
> `optional` **output**: [`MdastPlugin`](MdastPlugin.md)[]
|
|
58
58
|
|
|
59
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
59
|
+
Defined in: [packages/mdast-plus/src/types.ts:80](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L80)
|
|
60
60
|
|
|
61
61
|
Plugins used for serializing the AST into this format (Finalizer + Stringifier).
|
|
62
62
|
|
|
@@ -66,6 +66,6 @@ Plugins used for serializing the AST into this format (Finalizer + Stringifier).
|
|
|
66
66
|
|
|
67
67
|
> `optional` **title**: `string`
|
|
68
68
|
|
|
69
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
69
|
+
Defined in: [packages/mdast-plus/src/types.ts:70](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L70)
|
|
70
70
|
|
|
71
71
|
Human-readable title.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastMark
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:97](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L97)
|
|
10
10
|
|
|
11
11
|
Represents a highlighted text (mark) node in mdast.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Represents a highlighted text (mark) node in mdast.
|
|
|
20
20
|
|
|
21
21
|
> **children**: `PhrasingContent`[]
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:99](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L99)
|
|
24
24
|
|
|
25
25
|
List of children.
|
|
26
26
|
|
|
@@ -65,7 +65,7 @@ have a position.
|
|
|
65
65
|
|
|
66
66
|
> **type**: `"mark"`
|
|
67
67
|
|
|
68
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
68
|
+
Defined in: [packages/mdast-plus/src/types.ts:98](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L98)
|
|
69
69
|
|
|
70
70
|
Node type.
|
|
71
71
|
|