@isdk/mdast-plus 0.2.1 → 0.2.2
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 +25 -0
- package/README.md +25 -0
- package/dist/index.d.mts +34 -7
- package/dist/index.d.ts +34 -7
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +25 -0
- package/docs/_media/CONTRIBUTING.md +26 -0
- package/docs/_media/README.cn.md +25 -0
- package/docs/classes/MdastBasePipeline.md +57 -23
- package/docs/classes/MdastPipeline.md +74 -42
- 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 +1 -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 +9 -9
- package/docs/interfaces/MdastSub.md +3 -3
- package/docs/interfaces/MdastSup.md +3 -3
- package/docs/interfaces/PipelineRunOptions.md +44 -0
- package/docs/interfaces/ReadabilityOptions.md +13 -5
- 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 +1 -1
- package/docs/variables/htmlReadabilityPlugin.md +1 -1
- package/docs/variables/htmlReadabilityPlugins.md +1 -1
- package/docs/variables/markdownFormat.md +1 -1
- package/docs/variables/restoreReadabilityMetaPlugin.md +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: MdastBasePipeline
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:26](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:26](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L26)
|
|
10
10
|
|
|
11
11
|
Base implementation of the fluent mdast processing pipeline.
|
|
12
12
|
Manages the plugin registry and the execution queue.
|
|
@@ -21,7 +21,7 @@ Manages the plugin registry and the execution queue.
|
|
|
21
21
|
|
|
22
22
|
> **new MdastBasePipeline**(`input`): `MdastBasePipeline`
|
|
23
23
|
|
|
24
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:54](https://github.com/isdk/mdast-plus.js/blob/
|
|
24
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:54](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L54)
|
|
25
25
|
|
|
26
26
|
Initializes a new pipeline instance with the given input.
|
|
27
27
|
|
|
@@ -43,7 +43,7 @@ Content to process (string, Buffer, VFile, or AST Node).
|
|
|
43
43
|
|
|
44
44
|
> `protected` **\_data**: `Record`\<`string`, `any`\> = `{}`
|
|
45
45
|
|
|
46
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:48](https://github.com/isdk/mdast-plus.js/blob/
|
|
46
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:48](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L48)
|
|
47
47
|
|
|
48
48
|
***
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:48](https://github.com/isdk/mda
|
|
|
51
51
|
|
|
52
52
|
> `protected` **input**: `Compatible`
|
|
53
53
|
|
|
54
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:46](https://github.com/isdk/mdast-plus.js/blob/
|
|
54
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:46](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L46)
|
|
55
55
|
|
|
56
56
|
***
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:46](https://github.com/isdk/mda
|
|
|
59
59
|
|
|
60
60
|
> `protected` **queue**: [`MdastPlugin`](../interfaces/MdastPlugin.md)[] = `[]`
|
|
61
61
|
|
|
62
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:47](https://github.com/isdk/mdast-plus.js/blob/
|
|
62
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:47](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L47)
|
|
63
63
|
|
|
64
64
|
## Methods
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:47](https://github.com/isdk/mda
|
|
|
67
67
|
|
|
68
68
|
> `protected` **assembleProcessor**(`queue`): `Processor`
|
|
69
69
|
|
|
70
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
70
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:426](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L426)
|
|
71
71
|
|
|
72
72
|
Assembles a unified processor based on the sorted plugin queue.
|
|
73
73
|
|
|
@@ -87,7 +87,7 @@ Assembles a unified processor based on the sorted plugin queue.
|
|
|
87
87
|
|
|
88
88
|
> **configure**(`pluginName`, ...`options`): `this`
|
|
89
89
|
|
|
90
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
90
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:410](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L410)
|
|
91
91
|
|
|
92
92
|
Modifies the options of a plugin that is already in the pipeline queue.
|
|
93
93
|
Searches from the end of the queue and updates the first match found.
|
|
@@ -119,7 +119,7 @@ The pipeline instance for chaining.
|
|
|
119
119
|
|
|
120
120
|
> **data**(`key`, `value?`): `this`
|
|
121
121
|
|
|
122
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mdast-plus.js/blob/
|
|
122
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L64)
|
|
123
123
|
|
|
124
124
|
Configures global data for the pipeline, which will be available to all plugins via this.data().
|
|
125
125
|
|
|
@@ -149,7 +149,7 @@ The pipeline instance for chaining.
|
|
|
149
149
|
|
|
150
150
|
> `protected` **ensureInputPlugins**(`queue`, `overrides?`, `maxStage?`): `void`
|
|
151
151
|
|
|
152
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:149](https://github.com/isdk/mdast-plus.js/blob/
|
|
152
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:149](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L149)
|
|
153
153
|
|
|
154
154
|
Ensures that input plugins (parser, normalizers) are present in the queue.
|
|
155
155
|
Adds implicit plugins if no parser is detected.
|
|
@@ -178,7 +178,7 @@ Adds implicit plugins if no parser is detected.
|
|
|
178
178
|
|
|
179
179
|
> **from**(`fmt`, `overrides?`): `this`
|
|
180
180
|
|
|
181
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:178](https://github.com/isdk/mdast-plus.js/blob/
|
|
181
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:178](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L178)
|
|
182
182
|
|
|
183
183
|
Configures the input format and adds its associated plugins to the pipeline.
|
|
184
184
|
|
|
@@ -208,7 +208,7 @@ The pipeline instance for chaining.
|
|
|
208
208
|
|
|
209
209
|
> **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
210
210
|
|
|
211
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:76](https://github.com/isdk/mdast-plus.js/blob/
|
|
211
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:76](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L76)
|
|
212
212
|
|
|
213
213
|
Instance-level access to the global format registry.
|
|
214
214
|
|
|
@@ -228,7 +228,7 @@ Instance-level access to the global format registry.
|
|
|
228
228
|
|
|
229
229
|
> **priority**(`order`): `this`
|
|
230
230
|
|
|
231
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
231
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:393](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L393)
|
|
232
232
|
|
|
233
233
|
Sets the priority order for the most recently added plugin.
|
|
234
234
|
Plugins with lower order run earlier within the same stage.
|
|
@@ -249,11 +249,45 @@ The pipeline instance for chaining.
|
|
|
249
249
|
|
|
250
250
|
***
|
|
251
251
|
|
|
252
|
+
### resolveRunQueue()
|
|
253
|
+
|
|
254
|
+
> `protected` **resolveRunQueue**(`format`, `overrides?`, `stage?`, `stopAtIndex?`): [`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
255
|
+
|
|
256
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:198](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L198)
|
|
257
|
+
|
|
258
|
+
Resolves the final plugin queue for execution based on the target format and run options.
|
|
259
|
+
Calculates the effective plugin list by applying overrides, handling partial execution (stage/stopAtIndex),
|
|
260
|
+
and injecting necessary input/output plugins.
|
|
261
|
+
|
|
262
|
+
#### Parameters
|
|
263
|
+
|
|
264
|
+
##### format
|
|
265
|
+
|
|
266
|
+
[`MdastFormat`](../interfaces/MdastFormat.md)
|
|
267
|
+
|
|
268
|
+
##### overrides?
|
|
269
|
+
|
|
270
|
+
`Record`\<`string`, `any`\>
|
|
271
|
+
|
|
272
|
+
##### stage?
|
|
273
|
+
|
|
274
|
+
[`PipelineStage`](../enumerations/PipelineStage.md)
|
|
275
|
+
|
|
276
|
+
##### stopAtIndex?
|
|
277
|
+
|
|
278
|
+
`number`
|
|
279
|
+
|
|
280
|
+
#### Returns
|
|
281
|
+
|
|
282
|
+
[`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
283
|
+
|
|
284
|
+
***
|
|
285
|
+
|
|
252
286
|
### to()
|
|
253
287
|
|
|
254
|
-
> **to**(`fmt`, `
|
|
288
|
+
> **to**(`fmt`, `optionsOrOverrides?`): `Promise`\<`VFile`\>
|
|
255
289
|
|
|
256
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
290
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:274](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L274)
|
|
257
291
|
|
|
258
292
|
Processes the pipeline and serializes the result into the specified format.
|
|
259
293
|
|
|
@@ -265,11 +299,11 @@ Target format ID or definition.
|
|
|
265
299
|
|
|
266
300
|
`string` | [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
267
301
|
|
|
268
|
-
#####
|
|
302
|
+
##### optionsOrOverrides?
|
|
269
303
|
|
|
270
|
-
|
|
304
|
+
Pipeline execution options or plugin option overrides.
|
|
271
305
|
|
|
272
|
-
|
|
306
|
+
[`PipelineRunOptions`](../interfaces/PipelineRunOptions.md) | `Record`\<`string`, `any`\>
|
|
273
307
|
|
|
274
308
|
#### Returns
|
|
275
309
|
|
|
@@ -283,7 +317,7 @@ A promise resolving to a VFile containing the result.
|
|
|
283
317
|
|
|
284
318
|
> `protected` **toRuntimeEntry**(`entry`, `defaultStage`, `overrides?`): [`MdastPlugin`](../interfaces/MdastPlugin.md) & `object`
|
|
285
319
|
|
|
286
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:100](https://github.com/isdk/mdast-plus.js/blob/
|
|
320
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:100](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L100)
|
|
287
321
|
|
|
288
322
|
Normalizes a plugin entry for runtime execution.
|
|
289
323
|
|
|
@@ -311,7 +345,7 @@ Normalizes a plugin entry for runtime execution.
|
|
|
311
345
|
|
|
312
346
|
> **use**(`plugin`, ...`options`): `this`
|
|
313
347
|
|
|
314
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
348
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:320](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L320)
|
|
315
349
|
|
|
316
350
|
Adds a plugin or an array of plugins to the pipeline's compile stage.
|
|
317
351
|
|
|
@@ -343,7 +377,7 @@ The pipeline instance for chaining.
|
|
|
343
377
|
|
|
344
378
|
> **useAt**(`stage`, `plugin`, ...`options`): `this`
|
|
345
379
|
|
|
346
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
380
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:331](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L331)
|
|
347
381
|
|
|
348
382
|
Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
349
383
|
|
|
@@ -377,7 +411,7 @@ The pipeline instance for chaining.
|
|
|
377
411
|
|
|
378
412
|
> **useAt**(`plugin`, ...`options`): `this`
|
|
379
413
|
|
|
380
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
414
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:338](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L338)
|
|
381
415
|
|
|
382
416
|
Adds a plugin or an array of plugins to the pipeline. The stage is taken from the plugin object(s).
|
|
383
417
|
|
|
@@ -407,7 +441,7 @@ The pipeline instance for chaining.
|
|
|
407
441
|
|
|
408
442
|
> `static` **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
409
443
|
|
|
410
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/
|
|
444
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L42)
|
|
411
445
|
|
|
412
446
|
Retrieves a registered format by its ID.
|
|
413
447
|
|
|
@@ -431,7 +465,7 @@ The format definition or undefined if not found.
|
|
|
431
465
|
|
|
432
466
|
> `static` **register**(`format`): `void`
|
|
433
467
|
|
|
434
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:33](https://github.com/isdk/mdast-plus.js/blob/
|
|
468
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:33](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L33)
|
|
435
469
|
|
|
436
470
|
Registers a global document format.
|
|
437
471
|
|
|
@@ -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:507](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L507)
|
|
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:54](https://github.com/isdk/mdast-plus.js/blob/
|
|
23
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:54](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L54)
|
|
24
24
|
|
|
25
25
|
Initializes a new pipeline instance with the given input.
|
|
26
26
|
|
|
@@ -46,7 +46,7 @@ Content to process (string, Buffer, VFile, or AST Node).
|
|
|
46
46
|
|
|
47
47
|
> `protected` **\_data**: `Record`\<`string`, `any`\> = `{}`
|
|
48
48
|
|
|
49
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:48](https://github.com/isdk/mdast-plus.js/blob/
|
|
49
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:48](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L48)
|
|
50
50
|
|
|
51
51
|
#### Inherited from
|
|
52
52
|
|
|
@@ -58,7 +58,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:48](https://github.com/isdk/mda
|
|
|
58
58
|
|
|
59
59
|
> `protected` **input**: `Compatible`
|
|
60
60
|
|
|
61
|
-
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/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L46)
|
|
62
62
|
|
|
63
63
|
#### Inherited from
|
|
64
64
|
|
|
@@ -70,7 +70,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:46](https://github.com/isdk/mda
|
|
|
70
70
|
|
|
71
71
|
> `protected` **queue**: [`MdastPlugin`](../interfaces/MdastPlugin.md)[] = `[]`
|
|
72
72
|
|
|
73
|
-
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/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L47)
|
|
74
74
|
|
|
75
75
|
#### Inherited from
|
|
76
76
|
|
|
@@ -82,7 +82,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:47](https://github.com/isdk/mda
|
|
|
82
82
|
|
|
83
83
|
> `protected` **assembleProcessor**(`queue`): `Processor`
|
|
84
84
|
|
|
85
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
85
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:426](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L426)
|
|
86
86
|
|
|
87
87
|
Assembles a unified processor based on the sorted plugin queue.
|
|
88
88
|
|
|
@@ -106,7 +106,7 @@ Assembles a unified processor based on the sorted plugin queue.
|
|
|
106
106
|
|
|
107
107
|
> **configure**(`pluginName`, ...`options`): `this`
|
|
108
108
|
|
|
109
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
109
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:410](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L410)
|
|
110
110
|
|
|
111
111
|
Modifies the options of a plugin that is already in the pipeline queue.
|
|
112
112
|
Searches from the end of the queue and updates the first match found.
|
|
@@ -142,7 +142,7 @@ The pipeline instance for chaining.
|
|
|
142
142
|
|
|
143
143
|
> **data**(`key`, `value?`): `this`
|
|
144
144
|
|
|
145
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mdast-plus.js/blob/
|
|
145
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L64)
|
|
146
146
|
|
|
147
147
|
Configures global data for the pipeline, which will be available to all plugins via this.data().
|
|
148
148
|
|
|
@@ -176,7 +176,7 @@ The pipeline instance for chaining.
|
|
|
176
176
|
|
|
177
177
|
> `protected` **ensureInputPlugins**(`queue`, `overrides?`, `maxStage?`): `void`
|
|
178
178
|
|
|
179
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:149](https://github.com/isdk/mdast-plus.js/blob/
|
|
179
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:149](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L149)
|
|
180
180
|
|
|
181
181
|
Ensures that input plugins (parser, normalizers) are present in the queue.
|
|
182
182
|
Adds implicit plugins if no parser is detected.
|
|
@@ -209,7 +209,7 @@ Adds implicit plugins if no parser is detected.
|
|
|
209
209
|
|
|
210
210
|
> **from**(`fmt`, `overrides?`): `this`
|
|
211
211
|
|
|
212
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:178](https://github.com/isdk/mdast-plus.js/blob/
|
|
212
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:178](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L178)
|
|
213
213
|
|
|
214
214
|
Configures the input format and adds its associated plugins to the pipeline.
|
|
215
215
|
|
|
@@ -243,7 +243,7 @@ The pipeline instance for chaining.
|
|
|
243
243
|
|
|
244
244
|
> **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
245
245
|
|
|
246
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:76](https://github.com/isdk/mdast-plus.js/blob/
|
|
246
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:76](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L76)
|
|
247
247
|
|
|
248
248
|
Instance-level access to the global format registry.
|
|
249
249
|
|
|
@@ -267,7 +267,7 @@ Instance-level access to the global format registry.
|
|
|
267
267
|
|
|
268
268
|
> **priority**(`order`): `this`
|
|
269
269
|
|
|
270
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
270
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:393](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L393)
|
|
271
271
|
|
|
272
272
|
Sets the priority order for the most recently added plugin.
|
|
273
273
|
Plugins with lower order run earlier within the same stage.
|
|
@@ -292,11 +292,49 @@ The pipeline instance for chaining.
|
|
|
292
292
|
|
|
293
293
|
***
|
|
294
294
|
|
|
295
|
+
### resolveRunQueue()
|
|
296
|
+
|
|
297
|
+
> `protected` **resolveRunQueue**(`format`, `overrides?`, `stage?`, `stopAtIndex?`): [`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
298
|
+
|
|
299
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:198](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L198)
|
|
300
|
+
|
|
301
|
+
Resolves the final plugin queue for execution based on the target format and run options.
|
|
302
|
+
Calculates the effective plugin list by applying overrides, handling partial execution (stage/stopAtIndex),
|
|
303
|
+
and injecting necessary input/output plugins.
|
|
304
|
+
|
|
305
|
+
#### Parameters
|
|
306
|
+
|
|
307
|
+
##### format
|
|
308
|
+
|
|
309
|
+
[`MdastFormat`](../interfaces/MdastFormat.md)
|
|
310
|
+
|
|
311
|
+
##### overrides?
|
|
312
|
+
|
|
313
|
+
`Record`\<`string`, `any`\>
|
|
314
|
+
|
|
315
|
+
##### stage?
|
|
316
|
+
|
|
317
|
+
[`PipelineStage`](../enumerations/PipelineStage.md)
|
|
318
|
+
|
|
319
|
+
##### stopAtIndex?
|
|
320
|
+
|
|
321
|
+
`number`
|
|
322
|
+
|
|
323
|
+
#### Returns
|
|
324
|
+
|
|
325
|
+
[`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
326
|
+
|
|
327
|
+
#### Inherited from
|
|
328
|
+
|
|
329
|
+
[`MdastBasePipeline`](MdastBasePipeline.md).[`resolveRunQueue`](MdastBasePipeline.md#resolverunqueue)
|
|
330
|
+
|
|
331
|
+
***
|
|
332
|
+
|
|
295
333
|
### to()
|
|
296
334
|
|
|
297
|
-
> **to**(`fmt`, `
|
|
335
|
+
> **to**(`fmt`, `optionsOrOverrides?`): `Promise`\<`VFile`\>
|
|
298
336
|
|
|
299
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
337
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:274](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L274)
|
|
300
338
|
|
|
301
339
|
Processes the pipeline and serializes the result into the specified format.
|
|
302
340
|
|
|
@@ -308,11 +346,11 @@ Target format ID or definition.
|
|
|
308
346
|
|
|
309
347
|
`string` | [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
310
348
|
|
|
311
|
-
#####
|
|
349
|
+
##### optionsOrOverrides?
|
|
312
350
|
|
|
313
|
-
|
|
351
|
+
Pipeline execution options or plugin option overrides.
|
|
314
352
|
|
|
315
|
-
|
|
353
|
+
[`PipelineRunOptions`](../interfaces/PipelineRunOptions.md) | `Record`\<`string`, `any`\>
|
|
316
354
|
|
|
317
355
|
#### Returns
|
|
318
356
|
|
|
@@ -330,7 +368,7 @@ A promise resolving to a VFile containing the result.
|
|
|
330
368
|
|
|
331
369
|
> **toAst**(`options?`): `Promise`\<`Root`\>
|
|
332
370
|
|
|
333
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
371
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:545](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L545)
|
|
334
372
|
|
|
335
373
|
Finalizes the pipeline and returns the resulting AST (Root node).
|
|
336
374
|
|
|
@@ -338,19 +376,9 @@ Finalizes the pipeline and returns the resulting AST (Root node).
|
|
|
338
376
|
|
|
339
377
|
##### options?
|
|
340
378
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
###### overrides?
|
|
344
|
-
|
|
345
|
-
`Record`\<`string`, `any`\>
|
|
346
|
-
|
|
347
|
-
Map for plugin option overrides.
|
|
379
|
+
[`PipelineRunOptions`](../interfaces/PipelineRunOptions.md)
|
|
348
380
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
[`PipelineStage`](../enumerations/PipelineStage.md) \| `"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
352
|
-
|
|
353
|
-
Run the pipeline up to this stage only.
|
|
381
|
+
Configuration for the extraction.
|
|
354
382
|
|
|
355
383
|
#### Returns
|
|
356
384
|
|
|
@@ -362,7 +390,7 @@ Run the pipeline up to this stage only.
|
|
|
362
390
|
|
|
363
391
|
> **toAST**(`options?`): `Promise`\<`Root`\>
|
|
364
392
|
|
|
365
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
393
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:553](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L553)
|
|
366
394
|
|
|
367
395
|
Alias for toAst()
|
|
368
396
|
|
|
@@ -378,6 +406,10 @@ Alias for toAst()
|
|
|
378
406
|
|
|
379
407
|
[`PipelineStage`](../enumerations/PipelineStage.md) \| `"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
380
408
|
|
|
409
|
+
###### stopAtIndex?
|
|
410
|
+
|
|
411
|
+
`number`
|
|
412
|
+
|
|
381
413
|
#### Returns
|
|
382
414
|
|
|
383
415
|
`Promise`\<`Root`\>
|
|
@@ -388,7 +420,7 @@ Alias for toAst()
|
|
|
388
420
|
|
|
389
421
|
> **toHtml**(): `Promise`\<`string`\>
|
|
390
422
|
|
|
391
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
423
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:526](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L526)
|
|
392
424
|
|
|
393
425
|
Finalizes the pipeline and returns the result as an HTML string.
|
|
394
426
|
|
|
@@ -402,7 +434,7 @@ Finalizes the pipeline and returns the result as an HTML string.
|
|
|
402
434
|
|
|
403
435
|
> **toHTML**(): `Promise`\<`string`\>
|
|
404
436
|
|
|
405
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
437
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:551](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L551)
|
|
406
438
|
|
|
407
439
|
Alias for toHtml()
|
|
408
440
|
|
|
@@ -416,7 +448,7 @@ Alias for toHtml()
|
|
|
416
448
|
|
|
417
449
|
> **toHtmlVFile**(): `Promise`\<`VFile`\>
|
|
418
450
|
|
|
419
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
451
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:534](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L534)
|
|
420
452
|
|
|
421
453
|
Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
422
454
|
|
|
@@ -430,7 +462,7 @@ Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
|
430
462
|
|
|
431
463
|
> **toMarkdown**(): `Promise`\<`string`\>
|
|
432
464
|
|
|
433
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
465
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:511](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L511)
|
|
434
466
|
|
|
435
467
|
Finalizes the pipeline and returns the result as a Markdown string.
|
|
436
468
|
|
|
@@ -444,7 +476,7 @@ Finalizes the pipeline and returns the result as a Markdown string.
|
|
|
444
476
|
|
|
445
477
|
> **toMarkdownVFile**(): `Promise`\<`VFile`\>
|
|
446
478
|
|
|
447
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
479
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:519](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L519)
|
|
448
480
|
|
|
449
481
|
Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
450
482
|
|
|
@@ -458,7 +490,7 @@ Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
|
458
490
|
|
|
459
491
|
> `protected` **toRuntimeEntry**(`entry`, `defaultStage`, `overrides?`): [`MdastPlugin`](../interfaces/MdastPlugin.md) & `object`
|
|
460
492
|
|
|
461
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:100](https://github.com/isdk/mdast-plus.js/blob/
|
|
493
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:100](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L100)
|
|
462
494
|
|
|
463
495
|
Normalizes a plugin entry for runtime execution.
|
|
464
496
|
|
|
@@ -490,7 +522,7 @@ Normalizes a plugin entry for runtime execution.
|
|
|
490
522
|
|
|
491
523
|
> **use**(`plugin`, ...`options`): `this`
|
|
492
524
|
|
|
493
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
525
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:320](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L320)
|
|
494
526
|
|
|
495
527
|
Adds a plugin or an array of plugins to the pipeline's compile stage.
|
|
496
528
|
|
|
@@ -526,7 +558,7 @@ The pipeline instance for chaining.
|
|
|
526
558
|
|
|
527
559
|
> **useAt**(`stage`, `plugin`, ...`options`): `this`
|
|
528
560
|
|
|
529
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
561
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:331](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L331)
|
|
530
562
|
|
|
531
563
|
Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
532
564
|
|
|
@@ -564,7 +596,7 @@ The pipeline instance for chaining.
|
|
|
564
596
|
|
|
565
597
|
> **useAt**(`plugin`, ...`options`): `this`
|
|
566
598
|
|
|
567
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
599
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:338](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L338)
|
|
568
600
|
|
|
569
601
|
Adds a plugin or an array of plugins to the pipeline. The stage is taken from the plugin object(s).
|
|
570
602
|
|
|
@@ -598,7 +630,7 @@ The pipeline instance for chaining.
|
|
|
598
630
|
|
|
599
631
|
> `static` **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
600
632
|
|
|
601
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/
|
|
633
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L42)
|
|
602
634
|
|
|
603
635
|
Retrieves a registered format by its ID.
|
|
604
636
|
|
|
@@ -626,7 +658,7 @@ The format definition or undefined if not found.
|
|
|
626
658
|
|
|
627
659
|
> `static` **register**(`format`): `void`
|
|
628
660
|
|
|
629
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:33](https://github.com/isdk/mdast-plus.js/blob/
|
|
661
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:33](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L33)
|
|
630
662
|
|
|
631
663
|
Registers a global document format.
|
|
632
664
|
|
|
@@ -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/f87faaaa5512a2a313584cbae97a686bf2807b44/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/f87faaaa5512a2a313584cbae97a686bf2807b44/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/f87faaaa5512a2a313584cbae97a686bf2807b44/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/f87faaaa5512a2a313584cbae97a686bf2807b44/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/f87faaaa5512a2a313584cbae97a686bf2807b44/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/f87faaaa5512a2a313584cbae97a686bf2807b44/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/f87faaaa5512a2a313584cbae97a686bf2807b44/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/f87faaaa5512a2a313584cbae97a686bf2807b44/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:565](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L565)
|
|
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
|
+
- [PipelineRunOptions](interfaces/PipelineRunOptions.md)
|
|
24
25
|
- [ReadabilityOptions](interfaces/ReadabilityOptions.md)
|
|
25
26
|
|
|
26
27
|
## Type Aliases
|