@isdk/mdast-plus 0.2.0 → 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 +27 -0
- package/README.md +27 -0
- package/dist/index.d.mts +55 -15
- package/dist/index.d.ts +55 -15
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +27 -0
- package/docs/_media/CONTRIBUTING.md +28 -0
- package/docs/_media/README.cn.md +27 -0
- package/docs/classes/MdastBasePipeline.md +90 -24
- package/docs/classes/MdastPipeline.md +112 -44
- 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 +23 -7
- 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 +2 -2
- package/docs/variables/htmlReadabilityPlugin.md +6 -2
- package/docs/variables/htmlReadabilityPlugins.md +2 -2
- 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
|
|
|
@@ -83,11 +83,43 @@ Assembles a unified processor based on the sorted plugin queue.
|
|
|
83
83
|
|
|
84
84
|
***
|
|
85
85
|
|
|
86
|
+
### configure()
|
|
87
|
+
|
|
88
|
+
> **configure**(`pluginName`, ...`options`): `this`
|
|
89
|
+
|
|
90
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:410](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L410)
|
|
91
|
+
|
|
92
|
+
Modifies the options of a plugin that is already in the pipeline queue.
|
|
93
|
+
Searches from the end of the queue and updates the first match found.
|
|
94
|
+
|
|
95
|
+
#### Parameters
|
|
96
|
+
|
|
97
|
+
##### pluginName
|
|
98
|
+
|
|
99
|
+
`string`
|
|
100
|
+
|
|
101
|
+
The name of the plugin to modify.
|
|
102
|
+
Matches against explicit plugin name or function name.
|
|
103
|
+
|
|
104
|
+
##### options
|
|
105
|
+
|
|
106
|
+
...`any`[]
|
|
107
|
+
|
|
108
|
+
The new options to pass to the plugin (replaces existing options).
|
|
109
|
+
|
|
110
|
+
#### Returns
|
|
111
|
+
|
|
112
|
+
`this`
|
|
113
|
+
|
|
114
|
+
The pipeline instance for chaining.
|
|
115
|
+
|
|
116
|
+
***
|
|
117
|
+
|
|
86
118
|
### data()
|
|
87
119
|
|
|
88
120
|
> **data**(`key`, `value?`): `this`
|
|
89
121
|
|
|
90
|
-
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)
|
|
91
123
|
|
|
92
124
|
Configures global data for the pipeline, which will be available to all plugins via this.data().
|
|
93
125
|
|
|
@@ -117,7 +149,7 @@ The pipeline instance for chaining.
|
|
|
117
149
|
|
|
118
150
|
> `protected` **ensureInputPlugins**(`queue`, `overrides?`, `maxStage?`): `void`
|
|
119
151
|
|
|
120
|
-
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)
|
|
121
153
|
|
|
122
154
|
Ensures that input plugins (parser, normalizers) are present in the queue.
|
|
123
155
|
Adds implicit plugins if no parser is detected.
|
|
@@ -146,7 +178,7 @@ Adds implicit plugins if no parser is detected.
|
|
|
146
178
|
|
|
147
179
|
> **from**(`fmt`, `overrides?`): `this`
|
|
148
180
|
|
|
149
|
-
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)
|
|
150
182
|
|
|
151
183
|
Configures the input format and adds its associated plugins to the pipeline.
|
|
152
184
|
|
|
@@ -176,7 +208,7 @@ The pipeline instance for chaining.
|
|
|
176
208
|
|
|
177
209
|
> **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
178
210
|
|
|
179
|
-
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)
|
|
180
212
|
|
|
181
213
|
Instance-level access to the global format registry.
|
|
182
214
|
|
|
@@ -196,7 +228,7 @@ Instance-level access to the global format registry.
|
|
|
196
228
|
|
|
197
229
|
> **priority**(`order`): `this`
|
|
198
230
|
|
|
199
|
-
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)
|
|
200
232
|
|
|
201
233
|
Sets the priority order for the most recently added plugin.
|
|
202
234
|
Plugins with lower order run earlier within the same stage.
|
|
@@ -217,11 +249,45 @@ The pipeline instance for chaining.
|
|
|
217
249
|
|
|
218
250
|
***
|
|
219
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
|
+
|
|
220
286
|
### to()
|
|
221
287
|
|
|
222
|
-
> **to**(`fmt`, `
|
|
288
|
+
> **to**(`fmt`, `optionsOrOverrides?`): `Promise`\<`VFile`\>
|
|
223
289
|
|
|
224
|
-
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)
|
|
225
291
|
|
|
226
292
|
Processes the pipeline and serializes the result into the specified format.
|
|
227
293
|
|
|
@@ -233,11 +299,11 @@ Target format ID or definition.
|
|
|
233
299
|
|
|
234
300
|
`string` | [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
235
301
|
|
|
236
|
-
#####
|
|
302
|
+
##### optionsOrOverrides?
|
|
237
303
|
|
|
238
|
-
|
|
304
|
+
Pipeline execution options or plugin option overrides.
|
|
239
305
|
|
|
240
|
-
|
|
306
|
+
[`PipelineRunOptions`](../interfaces/PipelineRunOptions.md) | `Record`\<`string`, `any`\>
|
|
241
307
|
|
|
242
308
|
#### Returns
|
|
243
309
|
|
|
@@ -251,7 +317,7 @@ A promise resolving to a VFile containing the result.
|
|
|
251
317
|
|
|
252
318
|
> `protected` **toRuntimeEntry**(`entry`, `defaultStage`, `overrides?`): [`MdastPlugin`](../interfaces/MdastPlugin.md) & `object`
|
|
253
319
|
|
|
254
|
-
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)
|
|
255
321
|
|
|
256
322
|
Normalizes a plugin entry for runtime execution.
|
|
257
323
|
|
|
@@ -279,7 +345,7 @@ Normalizes a plugin entry for runtime execution.
|
|
|
279
345
|
|
|
280
346
|
> **use**(`plugin`, ...`options`): `this`
|
|
281
347
|
|
|
282
|
-
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)
|
|
283
349
|
|
|
284
350
|
Adds a plugin or an array of plugins to the pipeline's compile stage.
|
|
285
351
|
|
|
@@ -311,7 +377,7 @@ The pipeline instance for chaining.
|
|
|
311
377
|
|
|
312
378
|
> **useAt**(`stage`, `plugin`, ...`options`): `this`
|
|
313
379
|
|
|
314
|
-
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)
|
|
315
381
|
|
|
316
382
|
Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
317
383
|
|
|
@@ -321,7 +387,7 @@ Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
|
321
387
|
|
|
322
388
|
The stage name or numeric value.
|
|
323
389
|
|
|
324
|
-
`"parse"` | `"normalize"` | `"compile"` | `"finalize"` | `"stringify"`
|
|
390
|
+
[`PipelineStage`](../enumerations/PipelineStage.md) | `"parse"` | `"normalize"` | `"compile"` | `"finalize"` | `"stringify"`
|
|
325
391
|
|
|
326
392
|
###### plugin
|
|
327
393
|
|
|
@@ -345,7 +411,7 @@ The pipeline instance for chaining.
|
|
|
345
411
|
|
|
346
412
|
> **useAt**(`plugin`, ...`options`): `this`
|
|
347
413
|
|
|
348
|
-
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)
|
|
349
415
|
|
|
350
416
|
Adds a plugin or an array of plugins to the pipeline. The stage is taken from the plugin object(s).
|
|
351
417
|
|
|
@@ -355,7 +421,7 @@ Adds a plugin or an array of plugins to the pipeline. The stage is taken from th
|
|
|
355
421
|
|
|
356
422
|
The MdastPlugin object or an array of them.
|
|
357
423
|
|
|
358
|
-
[`MdastPlugin`](../interfaces/MdastPlugin.md) |
|
|
424
|
+
[`MdastPlugin`](../interfaces/MdastPlugin.md) | [`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
359
425
|
|
|
360
426
|
###### options
|
|
361
427
|
|
|
@@ -375,7 +441,7 @@ The pipeline instance for chaining.
|
|
|
375
441
|
|
|
376
442
|
> `static` **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
377
443
|
|
|
378
|
-
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)
|
|
379
445
|
|
|
380
446
|
Retrieves a registered format by its ID.
|
|
381
447
|
|
|
@@ -399,7 +465,7 @@ The format definition or undefined if not found.
|
|
|
399
465
|
|
|
400
466
|
> `static` **register**(`format`): `void`
|
|
401
467
|
|
|
402
|
-
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)
|
|
403
469
|
|
|
404
470
|
Registers a global document format.
|
|
405
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
|
|
|
@@ -102,11 +102,47 @@ Assembles a unified processor based on the sorted plugin queue.
|
|
|
102
102
|
|
|
103
103
|
***
|
|
104
104
|
|
|
105
|
+
### configure()
|
|
106
|
+
|
|
107
|
+
> **configure**(`pluginName`, ...`options`): `this`
|
|
108
|
+
|
|
109
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:410](https://github.com/isdk/mdast-plus.js/blob/f87faaaa5512a2a313584cbae97a686bf2807b44/src/pipeline.ts#L410)
|
|
110
|
+
|
|
111
|
+
Modifies the options of a plugin that is already in the pipeline queue.
|
|
112
|
+
Searches from the end of the queue and updates the first match found.
|
|
113
|
+
|
|
114
|
+
#### Parameters
|
|
115
|
+
|
|
116
|
+
##### pluginName
|
|
117
|
+
|
|
118
|
+
`string`
|
|
119
|
+
|
|
120
|
+
The name of the plugin to modify.
|
|
121
|
+
Matches against explicit plugin name or function name.
|
|
122
|
+
|
|
123
|
+
##### options
|
|
124
|
+
|
|
125
|
+
...`any`[]
|
|
126
|
+
|
|
127
|
+
The new options to pass to the plugin (replaces existing options).
|
|
128
|
+
|
|
129
|
+
#### Returns
|
|
130
|
+
|
|
131
|
+
`this`
|
|
132
|
+
|
|
133
|
+
The pipeline instance for chaining.
|
|
134
|
+
|
|
135
|
+
#### Inherited from
|
|
136
|
+
|
|
137
|
+
[`MdastBasePipeline`](MdastBasePipeline.md).[`configure`](MdastBasePipeline.md#configure)
|
|
138
|
+
|
|
139
|
+
***
|
|
140
|
+
|
|
105
141
|
### data()
|
|
106
142
|
|
|
107
143
|
> **data**(`key`, `value?`): `this`
|
|
108
144
|
|
|
109
|
-
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)
|
|
110
146
|
|
|
111
147
|
Configures global data for the pipeline, which will be available to all plugins via this.data().
|
|
112
148
|
|
|
@@ -140,7 +176,7 @@ The pipeline instance for chaining.
|
|
|
140
176
|
|
|
141
177
|
> `protected` **ensureInputPlugins**(`queue`, `overrides?`, `maxStage?`): `void`
|
|
142
178
|
|
|
143
|
-
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)
|
|
144
180
|
|
|
145
181
|
Ensures that input plugins (parser, normalizers) are present in the queue.
|
|
146
182
|
Adds implicit plugins if no parser is detected.
|
|
@@ -173,7 +209,7 @@ Adds implicit plugins if no parser is detected.
|
|
|
173
209
|
|
|
174
210
|
> **from**(`fmt`, `overrides?`): `this`
|
|
175
211
|
|
|
176
|
-
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)
|
|
177
213
|
|
|
178
214
|
Configures the input format and adds its associated plugins to the pipeline.
|
|
179
215
|
|
|
@@ -207,7 +243,7 @@ The pipeline instance for chaining.
|
|
|
207
243
|
|
|
208
244
|
> **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
209
245
|
|
|
210
|
-
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)
|
|
211
247
|
|
|
212
248
|
Instance-level access to the global format registry.
|
|
213
249
|
|
|
@@ -231,7 +267,7 @@ Instance-level access to the global format registry.
|
|
|
231
267
|
|
|
232
268
|
> **priority**(`order`): `this`
|
|
233
269
|
|
|
234
|
-
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)
|
|
235
271
|
|
|
236
272
|
Sets the priority order for the most recently added plugin.
|
|
237
273
|
Plugins with lower order run earlier within the same stage.
|
|
@@ -256,11 +292,49 @@ The pipeline instance for chaining.
|
|
|
256
292
|
|
|
257
293
|
***
|
|
258
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
|
+
|
|
259
333
|
### to()
|
|
260
334
|
|
|
261
|
-
> **to**(`fmt`, `
|
|
335
|
+
> **to**(`fmt`, `optionsOrOverrides?`): `Promise`\<`VFile`\>
|
|
262
336
|
|
|
263
|
-
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)
|
|
264
338
|
|
|
265
339
|
Processes the pipeline and serializes the result into the specified format.
|
|
266
340
|
|
|
@@ -272,11 +346,11 @@ Target format ID or definition.
|
|
|
272
346
|
|
|
273
347
|
`string` | [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
274
348
|
|
|
275
|
-
#####
|
|
349
|
+
##### optionsOrOverrides?
|
|
276
350
|
|
|
277
|
-
|
|
351
|
+
Pipeline execution options or plugin option overrides.
|
|
278
352
|
|
|
279
|
-
|
|
353
|
+
[`PipelineRunOptions`](../interfaces/PipelineRunOptions.md) | `Record`\<`string`, `any`\>
|
|
280
354
|
|
|
281
355
|
#### Returns
|
|
282
356
|
|
|
@@ -294,7 +368,7 @@ A promise resolving to a VFile containing the result.
|
|
|
294
368
|
|
|
295
369
|
> **toAst**(`options?`): `Promise`\<`Root`\>
|
|
296
370
|
|
|
297
|
-
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)
|
|
298
372
|
|
|
299
373
|
Finalizes the pipeline and returns the resulting AST (Root node).
|
|
300
374
|
|
|
@@ -302,19 +376,9 @@ Finalizes the pipeline and returns the resulting AST (Root node).
|
|
|
302
376
|
|
|
303
377
|
##### options?
|
|
304
378
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
###### overrides?
|
|
308
|
-
|
|
309
|
-
`Record`\<`string`, `any`\>
|
|
379
|
+
[`PipelineRunOptions`](../interfaces/PipelineRunOptions.md)
|
|
310
380
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
###### stage?
|
|
314
|
-
|
|
315
|
-
`"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
316
|
-
|
|
317
|
-
Run the pipeline up to this stage only.
|
|
381
|
+
Configuration for the extraction.
|
|
318
382
|
|
|
319
383
|
#### Returns
|
|
320
384
|
|
|
@@ -326,7 +390,7 @@ Run the pipeline up to this stage only.
|
|
|
326
390
|
|
|
327
391
|
> **toAST**(`options?`): `Promise`\<`Root`\>
|
|
328
392
|
|
|
329
|
-
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)
|
|
330
394
|
|
|
331
395
|
Alias for toAst()
|
|
332
396
|
|
|
@@ -340,7 +404,11 @@ Alias for toAst()
|
|
|
340
404
|
|
|
341
405
|
###### stage?
|
|
342
406
|
|
|
343
|
-
`"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
407
|
+
[`PipelineStage`](../enumerations/PipelineStage.md) \| `"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
408
|
+
|
|
409
|
+
###### stopAtIndex?
|
|
410
|
+
|
|
411
|
+
`number`
|
|
344
412
|
|
|
345
413
|
#### Returns
|
|
346
414
|
|
|
@@ -352,7 +420,7 @@ Alias for toAst()
|
|
|
352
420
|
|
|
353
421
|
> **toHtml**(): `Promise`\<`string`\>
|
|
354
422
|
|
|
355
|
-
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)
|
|
356
424
|
|
|
357
425
|
Finalizes the pipeline and returns the result as an HTML string.
|
|
358
426
|
|
|
@@ -366,7 +434,7 @@ Finalizes the pipeline and returns the result as an HTML string.
|
|
|
366
434
|
|
|
367
435
|
> **toHTML**(): `Promise`\<`string`\>
|
|
368
436
|
|
|
369
|
-
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)
|
|
370
438
|
|
|
371
439
|
Alias for toHtml()
|
|
372
440
|
|
|
@@ -380,7 +448,7 @@ Alias for toHtml()
|
|
|
380
448
|
|
|
381
449
|
> **toHtmlVFile**(): `Promise`\<`VFile`\>
|
|
382
450
|
|
|
383
|
-
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)
|
|
384
452
|
|
|
385
453
|
Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
386
454
|
|
|
@@ -394,7 +462,7 @@ Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
|
394
462
|
|
|
395
463
|
> **toMarkdown**(): `Promise`\<`string`\>
|
|
396
464
|
|
|
397
|
-
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)
|
|
398
466
|
|
|
399
467
|
Finalizes the pipeline and returns the result as a Markdown string.
|
|
400
468
|
|
|
@@ -408,7 +476,7 @@ Finalizes the pipeline and returns the result as a Markdown string.
|
|
|
408
476
|
|
|
409
477
|
> **toMarkdownVFile**(): `Promise`\<`VFile`\>
|
|
410
478
|
|
|
411
|
-
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)
|
|
412
480
|
|
|
413
481
|
Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
414
482
|
|
|
@@ -422,7 +490,7 @@ Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
|
422
490
|
|
|
423
491
|
> `protected` **toRuntimeEntry**(`entry`, `defaultStage`, `overrides?`): [`MdastPlugin`](../interfaces/MdastPlugin.md) & `object`
|
|
424
492
|
|
|
425
|
-
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)
|
|
426
494
|
|
|
427
495
|
Normalizes a plugin entry for runtime execution.
|
|
428
496
|
|
|
@@ -454,7 +522,7 @@ Normalizes a plugin entry for runtime execution.
|
|
|
454
522
|
|
|
455
523
|
> **use**(`plugin`, ...`options`): `this`
|
|
456
524
|
|
|
457
|
-
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)
|
|
458
526
|
|
|
459
527
|
Adds a plugin or an array of plugins to the pipeline's compile stage.
|
|
460
528
|
|
|
@@ -490,7 +558,7 @@ The pipeline instance for chaining.
|
|
|
490
558
|
|
|
491
559
|
> **useAt**(`stage`, `plugin`, ...`options`): `this`
|
|
492
560
|
|
|
493
|
-
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)
|
|
494
562
|
|
|
495
563
|
Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
496
564
|
|
|
@@ -500,7 +568,7 @@ Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
|
500
568
|
|
|
501
569
|
The stage name or numeric value.
|
|
502
570
|
|
|
503
|
-
`"parse"` | `"normalize"` | `"compile"` | `"finalize"` | `"stringify"`
|
|
571
|
+
[`PipelineStage`](../enumerations/PipelineStage.md) | `"parse"` | `"normalize"` | `"compile"` | `"finalize"` | `"stringify"`
|
|
504
572
|
|
|
505
573
|
###### plugin
|
|
506
574
|
|
|
@@ -528,7 +596,7 @@ The pipeline instance for chaining.
|
|
|
528
596
|
|
|
529
597
|
> **useAt**(`plugin`, ...`options`): `this`
|
|
530
598
|
|
|
531
|
-
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)
|
|
532
600
|
|
|
533
601
|
Adds a plugin or an array of plugins to the pipeline. The stage is taken from the plugin object(s).
|
|
534
602
|
|
|
@@ -538,7 +606,7 @@ Adds a plugin or an array of plugins to the pipeline. The stage is taken from th
|
|
|
538
606
|
|
|
539
607
|
The MdastPlugin object or an array of them.
|
|
540
608
|
|
|
541
|
-
[`MdastPlugin`](../interfaces/MdastPlugin.md) |
|
|
609
|
+
[`MdastPlugin`](../interfaces/MdastPlugin.md) | [`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
542
610
|
|
|
543
611
|
###### options
|
|
544
612
|
|
|
@@ -562,7 +630,7 @@ The pipeline instance for chaining.
|
|
|
562
630
|
|
|
563
631
|
> `static` **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
564
632
|
|
|
565
|
-
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)
|
|
566
634
|
|
|
567
635
|
Retrieves a registered format by its ID.
|
|
568
636
|
|
|
@@ -590,7 +658,7 @@ The format definition or undefined if not found.
|
|
|
590
658
|
|
|
591
659
|
> `static` **register**(`format`): `void`
|
|
592
660
|
|
|
593
|
-
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)
|
|
594
662
|
|
|
595
663
|
Registers a global document format.
|
|
596
664
|
|