@isdk/mdast-plus 0.3.3 → 0.3.4
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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/docs/classes/MdastBasePipeline.md +20 -20
- package/docs/classes/MdastPipeline.md +45 -31
- package/docs/enumerations/PipelineStage.md +6 -6
- package/docs/functions/astCompiler.md +1 -1
- package/docs/functions/checkHtmlUrlExists.md +1 -1
- package/docs/functions/checkUrlExists.md +1 -1
- package/docs/functions/jsonParser.md +1 -1
- package/docs/functions/mdast.md +1 -1
- 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 +4 -4
- package/docs/interfaces/ReadabilityOptions.md +11 -11
- package/docs/interfaces/SmartExcerptOptions.md +3 -3
- 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
package/dist/index.d.mts
CHANGED
|
@@ -1672,7 +1672,8 @@ declare class MdastPipeline extends MdastBasePipeline {
|
|
|
1672
1672
|
* @param options - Configuration options.
|
|
1673
1673
|
* @param options.attachMetadata - If true, returns a String object with metadata attached (if available).
|
|
1674
1674
|
*/
|
|
1675
|
-
toMarkdown(
|
|
1675
|
+
toMarkdown(): Promise<string>;
|
|
1676
|
+
toMarkdown(options: {
|
|
1676
1677
|
attachMetadata?: boolean;
|
|
1677
1678
|
}): Promise<string | String>;
|
|
1678
1679
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1672,7 +1672,8 @@ declare class MdastPipeline extends MdastBasePipeline {
|
|
|
1672
1672
|
* @param options - Configuration options.
|
|
1673
1673
|
* @param options.attachMetadata - If true, returns a String object with metadata attached (if available).
|
|
1674
1674
|
*/
|
|
1675
|
-
toMarkdown(
|
|
1675
|
+
toMarkdown(): Promise<string>;
|
|
1676
|
+
toMarkdown(options: {
|
|
1676
1677
|
attachMetadata?: boolean;
|
|
1677
1678
|
}): Promise<string | String>;
|
|
1678
1679
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: MdastBasePipeline
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:42](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L42)
|
|
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:70](https://github.com/isdk/mdast-plus.js/blob/
|
|
24
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:70](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L70)
|
|
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:64](https://github.com/isdk/mdast-plus.js/blob/
|
|
46
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L64)
|
|
47
47
|
|
|
48
48
|
***
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mda
|
|
|
51
51
|
|
|
52
52
|
> `protected` **input**: `Compatible`
|
|
53
53
|
|
|
54
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:62](https://github.com/isdk/mdast-plus.js/blob/
|
|
54
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:62](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L62)
|
|
55
55
|
|
|
56
56
|
***
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:62](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:63](https://github.com/isdk/mdast-plus.js/blob/
|
|
62
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:63](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L63)
|
|
63
63
|
|
|
64
64
|
## Methods
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:63](https://github.com/isdk/mda
|
|
|
67
67
|
|
|
68
68
|
> `protected` **assembleProcessor**(`queue`): `Processor`
|
|
69
69
|
|
|
70
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:494](https://github.com/isdk/mdast-plus.js/blob/
|
|
70
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:494](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L494)
|
|
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:478](https://github.com/isdk/mdast-plus.js/blob/
|
|
90
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:478](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L478)
|
|
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:80](https://github.com/isdk/mdast-plus.js/blob/
|
|
122
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:80](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L80)
|
|
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:165](https://github.com/isdk/mdast-plus.js/blob/
|
|
152
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:165](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L165)
|
|
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:194](https://github.com/isdk/mdast-plus.js/blob/
|
|
181
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:194](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L194)
|
|
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:92](https://github.com/isdk/mdast-plus.js/blob/
|
|
211
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:92](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L92)
|
|
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:461](https://github.com/isdk/mdast-plus.js/blob/
|
|
231
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:461](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L461)
|
|
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.
|
|
@@ -253,7 +253,7 @@ The pipeline instance for chaining.
|
|
|
253
253
|
|
|
254
254
|
> `protected` **resolveRunQueue**(`format`, `overrides?`, `stage?`, `stopAtIndex?`): [`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
255
255
|
|
|
256
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:214](https://github.com/isdk/mdast-plus.js/blob/
|
|
256
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:214](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L214)
|
|
257
257
|
|
|
258
258
|
Resolves the final plugin queue for execution based on the target format and run options.
|
|
259
259
|
Calculates the effective plugin list by applying overrides, handling partial execution (stage/stopAtIndex),
|
|
@@ -287,7 +287,7 @@ and injecting necessary input/output plugins.
|
|
|
287
287
|
|
|
288
288
|
> **to**(`fmt`, `optionsOrOverrides?`): `Promise`\<`VFile`\>
|
|
289
289
|
|
|
290
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:290](https://github.com/isdk/mdast-plus.js/blob/
|
|
290
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:290](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L290)
|
|
291
291
|
|
|
292
292
|
Processes the pipeline and serializes the result into the specified format.
|
|
293
293
|
|
|
@@ -317,7 +317,7 @@ A promise resolving to a VFile containing the result.
|
|
|
317
317
|
|
|
318
318
|
> `protected` **toRuntimeEntry**(`entry`, `defaultStage`, `overrides?`): [`MdastPlugin`](../interfaces/MdastPlugin.md) & `object`
|
|
319
319
|
|
|
320
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:116](https://github.com/isdk/mdast-plus.js/blob/
|
|
320
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:116](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L116)
|
|
321
321
|
|
|
322
322
|
Normalizes a plugin entry for runtime execution.
|
|
323
323
|
|
|
@@ -345,7 +345,7 @@ Normalizes a plugin entry for runtime execution.
|
|
|
345
345
|
|
|
346
346
|
> **use**(`plugin`, ...`options`): `this`
|
|
347
347
|
|
|
348
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:336](https://github.com/isdk/mdast-plus.js/blob/
|
|
348
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:336](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L336)
|
|
349
349
|
|
|
350
350
|
Adds a plugin or an array of plugins to the pipeline's compile stage.
|
|
351
351
|
|
|
@@ -377,7 +377,7 @@ The pipeline instance for chaining.
|
|
|
377
377
|
|
|
378
378
|
> **useAt**(`stage`, `plugin`, ...`options`): `this`
|
|
379
379
|
|
|
380
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:418](https://github.com/isdk/mdast-plus.js/blob/
|
|
380
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:418](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L418)
|
|
381
381
|
|
|
382
382
|
Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
383
383
|
|
|
@@ -411,7 +411,7 @@ The pipeline instance for chaining.
|
|
|
411
411
|
|
|
412
412
|
> **useAt**(`plugin`, ...`options`): `this`
|
|
413
413
|
|
|
414
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:425](https://github.com/isdk/mdast-plus.js/blob/
|
|
414
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:425](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L425)
|
|
415
415
|
|
|
416
416
|
Adds a plugin or an array of plugins to the pipeline. The stage is taken from the plugin object(s) or defaults to 'compile'.
|
|
417
417
|
|
|
@@ -441,7 +441,7 @@ The pipeline instance for chaining.
|
|
|
441
441
|
|
|
442
442
|
> `static` **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
443
443
|
|
|
444
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:58](https://github.com/isdk/mdast-plus.js/blob/
|
|
444
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:58](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L58)
|
|
445
445
|
|
|
446
446
|
Retrieves a registered format by its ID.
|
|
447
447
|
|
|
@@ -465,7 +465,7 @@ The format definition or undefined if not found.
|
|
|
465
465
|
|
|
466
466
|
> `static` **register**(`format`): `void`
|
|
467
467
|
|
|
468
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:49](https://github.com/isdk/mdast-plus.js/blob/
|
|
468
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:49](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L49)
|
|
469
469
|
|
|
470
470
|
Registers a global document format.
|
|
471
471
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: MdastPipeline
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:575](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:575](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L575)
|
|
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:70](https://github.com/isdk/mdast-plus.js/blob/
|
|
23
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:70](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L70)
|
|
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:64](https://github.com/isdk/mdast-plus.js/blob/
|
|
49
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L64)
|
|
50
50
|
|
|
51
51
|
#### Inherited from
|
|
52
52
|
|
|
@@ -58,7 +58,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:64](https://github.com/isdk/mda
|
|
|
58
58
|
|
|
59
59
|
> `protected` **input**: `Compatible`
|
|
60
60
|
|
|
61
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:62](https://github.com/isdk/mdast-plus.js/blob/
|
|
61
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:62](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L62)
|
|
62
62
|
|
|
63
63
|
#### Inherited from
|
|
64
64
|
|
|
@@ -70,7 +70,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:62](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:63](https://github.com/isdk/mdast-plus.js/blob/
|
|
73
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:63](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L63)
|
|
74
74
|
|
|
75
75
|
#### Inherited from
|
|
76
76
|
|
|
@@ -82,7 +82,7 @@ Defined in: [packages/mdast-plus/src/pipeline.ts:63](https://github.com/isdk/mda
|
|
|
82
82
|
|
|
83
83
|
> `protected` **assembleProcessor**(`queue`): `Processor`
|
|
84
84
|
|
|
85
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:494](https://github.com/isdk/mdast-plus.js/blob/
|
|
85
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:494](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L494)
|
|
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:478](https://github.com/isdk/mdast-plus.js/blob/
|
|
109
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:478](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L478)
|
|
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:80](https://github.com/isdk/mdast-plus.js/blob/
|
|
145
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:80](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L80)
|
|
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:165](https://github.com/isdk/mdast-plus.js/blob/
|
|
179
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:165](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L165)
|
|
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:194](https://github.com/isdk/mdast-plus.js/blob/
|
|
212
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:194](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L194)
|
|
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:92](https://github.com/isdk/mdast-plus.js/blob/
|
|
246
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:92](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L92)
|
|
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:461](https://github.com/isdk/mdast-plus.js/blob/
|
|
270
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:461](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L461)
|
|
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.
|
|
@@ -296,7 +296,7 @@ The pipeline instance for chaining.
|
|
|
296
296
|
|
|
297
297
|
> `protected` **resolveRunQueue**(`format`, `overrides?`, `stage?`, `stopAtIndex?`): [`MdastPlugin`](../interfaces/MdastPlugin.md)[]
|
|
298
298
|
|
|
299
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:214](https://github.com/isdk/mdast-plus.js/blob/
|
|
299
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:214](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L214)
|
|
300
300
|
|
|
301
301
|
Resolves the final plugin queue for execution based on the target format and run options.
|
|
302
302
|
Calculates the effective plugin list by applying overrides, handling partial execution (stage/stopAtIndex),
|
|
@@ -334,7 +334,7 @@ and injecting necessary input/output plugins.
|
|
|
334
334
|
|
|
335
335
|
> **to**(`fmt`, `optionsOrOverrides?`): `Promise`\<`VFile`\>
|
|
336
336
|
|
|
337
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:290](https://github.com/isdk/mdast-plus.js/blob/
|
|
337
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:290](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L290)
|
|
338
338
|
|
|
339
339
|
Processes the pipeline and serializes the result into the specified format.
|
|
340
340
|
|
|
@@ -368,7 +368,7 @@ A promise resolving to a VFile containing the result.
|
|
|
368
368
|
|
|
369
369
|
> **toAst**(`options?`): `Promise`\<`Root`\>
|
|
370
370
|
|
|
371
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
371
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:624](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L624)
|
|
372
372
|
|
|
373
373
|
Finalizes the pipeline and returns the resulting AST (Root node).
|
|
374
374
|
|
|
@@ -390,7 +390,7 @@ Configuration for the extraction.
|
|
|
390
390
|
|
|
391
391
|
> **toAST**(`options?`): `Promise`\<`Root`\>
|
|
392
392
|
|
|
393
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
393
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:632](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L632)
|
|
394
394
|
|
|
395
395
|
Alias for toAst()
|
|
396
396
|
|
|
@@ -420,7 +420,7 @@ Alias for toAst()
|
|
|
420
420
|
|
|
421
421
|
> **toHtml**(): `Promise`\<`string`\>
|
|
422
422
|
|
|
423
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
423
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:605](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L605)
|
|
424
424
|
|
|
425
425
|
Finalizes the pipeline and returns the result as an HTML string.
|
|
426
426
|
|
|
@@ -434,7 +434,7 @@ Finalizes the pipeline and returns the result as an HTML string.
|
|
|
434
434
|
|
|
435
435
|
> **toHTML**(): `Promise`\<`string`\>
|
|
436
436
|
|
|
437
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
437
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:630](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L630)
|
|
438
438
|
|
|
439
439
|
Alias for toHtml()
|
|
440
440
|
|
|
@@ -448,7 +448,7 @@ Alias for toHtml()
|
|
|
448
448
|
|
|
449
449
|
> **toHtmlVFile**(): `Promise`\<`VFile`\>
|
|
450
450
|
|
|
451
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
451
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:613](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L613)
|
|
452
452
|
|
|
453
453
|
Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
454
454
|
|
|
@@ -460,15 +460,29 @@ Finalizes the pipeline and returns a VFile containing the HTML result.
|
|
|
460
460
|
|
|
461
461
|
### toMarkdown()
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
#### Call Signature
|
|
464
|
+
|
|
465
|
+
> **toMarkdown**(): `Promise`\<`string`\>
|
|
464
466
|
|
|
465
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:581](https://github.com/isdk/mdast-plus.js/blob/
|
|
467
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:581](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L581)
|
|
466
468
|
|
|
467
469
|
Finalizes the pipeline and returns the result as a Markdown string.
|
|
468
470
|
|
|
469
|
-
|
|
471
|
+
##### Returns
|
|
470
472
|
|
|
471
|
-
|
|
473
|
+
`Promise`\<`string`\>
|
|
474
|
+
|
|
475
|
+
#### Call Signature
|
|
476
|
+
|
|
477
|
+
> **toMarkdown**(`options`): `Promise`\<`string` \| `String`\>
|
|
478
|
+
|
|
479
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:582](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L582)
|
|
480
|
+
|
|
481
|
+
Finalizes the pipeline and returns the result as a Markdown string.
|
|
482
|
+
|
|
483
|
+
##### Parameters
|
|
484
|
+
|
|
485
|
+
###### options
|
|
472
486
|
|
|
473
487
|
Configuration options.
|
|
474
488
|
|
|
@@ -478,7 +492,7 @@ Configuration options.
|
|
|
478
492
|
|
|
479
493
|
If true, returns a String object with metadata attached (if available).
|
|
480
494
|
|
|
481
|
-
|
|
495
|
+
##### Returns
|
|
482
496
|
|
|
483
497
|
`Promise`\<`string` \| `String`\>
|
|
484
498
|
|
|
@@ -488,7 +502,7 @@ If true, returns a String object with metadata attached (if available).
|
|
|
488
502
|
|
|
489
503
|
> **toMarkdownVFile**(): `Promise`\<`VFile`\>
|
|
490
504
|
|
|
491
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
505
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:598](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L598)
|
|
492
506
|
|
|
493
507
|
Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
494
508
|
|
|
@@ -502,7 +516,7 @@ Finalizes the pipeline and returns a VFile containing the Markdown result.
|
|
|
502
516
|
|
|
503
517
|
> `protected` **toRuntimeEntry**(`entry`, `defaultStage`, `overrides?`): [`MdastPlugin`](../interfaces/MdastPlugin.md) & `object`
|
|
504
518
|
|
|
505
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:116](https://github.com/isdk/mdast-plus.js/blob/
|
|
519
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:116](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L116)
|
|
506
520
|
|
|
507
521
|
Normalizes a plugin entry for runtime execution.
|
|
508
522
|
|
|
@@ -534,7 +548,7 @@ Normalizes a plugin entry for runtime execution.
|
|
|
534
548
|
|
|
535
549
|
> **use**(`plugin`, ...`options`): `this`
|
|
536
550
|
|
|
537
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:336](https://github.com/isdk/mdast-plus.js/blob/
|
|
551
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:336](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L336)
|
|
538
552
|
|
|
539
553
|
Adds a plugin or an array of plugins to the pipeline's compile stage.
|
|
540
554
|
|
|
@@ -570,7 +584,7 @@ The pipeline instance for chaining.
|
|
|
570
584
|
|
|
571
585
|
> **useAt**(`stage`, `plugin`, ...`options`): `this`
|
|
572
586
|
|
|
573
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:418](https://github.com/isdk/mdast-plus.js/blob/
|
|
587
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:418](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L418)
|
|
574
588
|
|
|
575
589
|
Adds a plugin or an array of plugins to the pipeline at a specific stage.
|
|
576
590
|
|
|
@@ -608,7 +622,7 @@ The pipeline instance for chaining.
|
|
|
608
622
|
|
|
609
623
|
> **useAt**(`plugin`, ...`options`): `this`
|
|
610
624
|
|
|
611
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:425](https://github.com/isdk/mdast-plus.js/blob/
|
|
625
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:425](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L425)
|
|
612
626
|
|
|
613
627
|
Adds a plugin or an array of plugins to the pipeline. The stage is taken from the plugin object(s) or defaults to 'compile'.
|
|
614
628
|
|
|
@@ -642,7 +656,7 @@ The pipeline instance for chaining.
|
|
|
642
656
|
|
|
643
657
|
> `static` **getFormat**(`id`): `undefined` \| [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
644
658
|
|
|
645
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:58](https://github.com/isdk/mdast-plus.js/blob/
|
|
659
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:58](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L58)
|
|
646
660
|
|
|
647
661
|
Retrieves a registered format by its ID.
|
|
648
662
|
|
|
@@ -670,7 +684,7 @@ The format definition or undefined if not found.
|
|
|
670
684
|
|
|
671
685
|
> `static` **register**(`format`): `void`
|
|
672
686
|
|
|
673
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:49](https://github.com/isdk/mdast-plus.js/blob/
|
|
687
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:49](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L49)
|
|
674
688
|
|
|
675
689
|
Registers a global document format.
|
|
676
690
|
|
|
@@ -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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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
|
> **checkHtmlUrlExists**(`tree`, `url`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:328](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:328](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L328)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **checkUrlExists**(`tree`, `url`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:314](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:314](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L314)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -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/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:644](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/pipeline.ts#L644)
|
|
12
12
|
|
|
13
13
|
Entry point for the fluent mdast-plus API.
|
|
14
14
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastDataOrigin
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:107](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:107](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L107)
|
|
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:109](https://github.com/isdk/mdast-plus.js/blob/
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:109](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L109)
|
|
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:113](https://github.com/isdk/mdast-plus.js/blob/
|
|
33
|
+
Defined in: [packages/mdast-plus/src/types.ts:113](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L113)
|
|
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:111](https://github.com/isdk/mdast-plus.js/blob/
|
|
43
|
+
Defined in: [packages/mdast-plus/src/types.ts:111](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L111)
|
|
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:66](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:66](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:72](https://github.com/isdk/mdast-plus.js/blob/
|
|
19
|
+
Defined in: [packages/mdast-plus/src/types.ts:72](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:68](https://github.com/isdk/mdast-plus.js/blob/
|
|
29
|
+
Defined in: [packages/mdast-plus/src/types.ts:68](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:77](https://github.com/isdk/mdast-plus.js/blob/
|
|
39
|
+
Defined in: [packages/mdast-plus/src/types.ts:77](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:74](https://github.com/isdk/mdast-plus.js/blob/
|
|
49
|
+
Defined in: [packages/mdast-plus/src/types.ts:74](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:80](https://github.com/isdk/mdast-plus.js/blob/
|
|
59
|
+
Defined in: [packages/mdast-plus/src/types.ts:80](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:70](https://github.com/isdk/mdast-plus.js/blob/
|
|
69
|
+
Defined in: [packages/mdast-plus/src/types.ts:70](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/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:118](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:118](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L118)
|
|
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:120](https://github.com/isdk/mdast-plus.js/blob/
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:120](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L120)
|
|
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:119](https://github.com/isdk/mdast-plus.js/blob/
|
|
68
|
+
Defined in: [packages/mdast-plus/src/types.ts:119](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L119)
|
|
69
69
|
|
|
70
70
|
Node type.
|
|
71
71
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastPlugin
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:33](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:33](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L33)
|
|
10
10
|
|
|
11
11
|
Configuration for a plugin within the mdast-plus pipeline.
|
|
12
12
|
It wraps a standard unified plugin with execution metadata.
|
|
@@ -17,7 +17,7 @@ It wraps a standard unified plugin with execution metadata.
|
|
|
17
17
|
|
|
18
18
|
> `optional` **after**: `string`
|
|
19
19
|
|
|
20
|
-
Defined in: [packages/mdast-plus/src/types.ts:60](https://github.com/isdk/mdast-plus.js/blob/
|
|
20
|
+
Defined in: [packages/mdast-plus/src/types.ts:60](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L60)
|
|
21
21
|
|
|
22
22
|
Run this plugin after the named plugin (within the same stage).
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ Run this plugin after the named plugin (within the same stage).
|
|
|
27
27
|
|
|
28
28
|
> `optional` **before**: `string`
|
|
29
29
|
|
|
30
|
-
Defined in: [packages/mdast-plus/src/types.ts:58](https://github.com/isdk/mdast-plus.js/blob/
|
|
30
|
+
Defined in: [packages/mdast-plus/src/types.ts:58](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L58)
|
|
31
31
|
|
|
32
32
|
Run this plugin before the named plugin (within the same stage).
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ Run this plugin before the named plugin (within the same stage).
|
|
|
37
37
|
|
|
38
38
|
> `optional` **main**: `boolean`
|
|
39
39
|
|
|
40
|
-
Defined in: [packages/mdast-plus/src/types.ts:56](https://github.com/isdk/mdast-plus.js/blob/
|
|
40
|
+
Defined in: [packages/mdast-plus/src/types.ts:56](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L56)
|
|
41
41
|
|
|
42
42
|
If true, this plugin is considered the "main" plugin for its stage.
|
|
43
43
|
When multiple plugins exist in the same stage, a 'main' plugin will
|
|
@@ -49,7 +49,7 @@ replace the default (first) plugin of that stage.
|
|
|
49
49
|
|
|
50
50
|
> `optional` **name**: `string`
|
|
51
51
|
|
|
52
|
-
Defined in: [packages/mdast-plus/src/types.ts:39](https://github.com/isdk/mdast-plus.js/blob/
|
|
52
|
+
Defined in: [packages/mdast-plus/src/types.ts:39](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L39)
|
|
53
53
|
|
|
54
54
|
Optional name for the plugin.
|
|
55
55
|
Used for identification in overrides and logging.
|
|
@@ -61,7 +61,7 @@ If not provided, defaults to the plugin function's name.
|
|
|
61
61
|
|
|
62
62
|
> `optional` **options**: `any`[]
|
|
63
63
|
|
|
64
|
-
Defined in: [packages/mdast-plus/src/types.ts:46](https://github.com/isdk/mdast-plus.js/blob/
|
|
64
|
+
Defined in: [packages/mdast-plus/src/types.ts:46](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L46)
|
|
65
65
|
|
|
66
66
|
Arguments passed to the plugin.
|
|
67
67
|
MUST be an array of arguments (e.g., [optionsObject]).
|
|
@@ -72,7 +72,7 @@ MUST be an array of arguments (e.g., [optionsObject]).
|
|
|
72
72
|
|
|
73
73
|
> `optional` **order**: `number`
|
|
74
74
|
|
|
75
|
-
Defined in: [packages/mdast-plus/src/types.ts:50](https://github.com/isdk/mdast-plus.js/blob/
|
|
75
|
+
Defined in: [packages/mdast-plus/src/types.ts:50](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L50)
|
|
76
76
|
|
|
77
77
|
Execution priority within the same stage. Lower values run earlier.
|
|
78
78
|
|
|
@@ -82,7 +82,7 @@ Execution priority within the same stage. Lower values run earlier.
|
|
|
82
82
|
|
|
83
83
|
> **plugin**: `Plugin`\<`any`[], `any`, `any`\>
|
|
84
84
|
|
|
85
|
-
Defined in: [packages/mdast-plus/src/types.ts:41](https://github.com/isdk/mdast-plus.js/blob/
|
|
85
|
+
Defined in: [packages/mdast-plus/src/types.ts:41](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L41)
|
|
86
86
|
|
|
87
87
|
The standard unified plugin (attacher) function.
|
|
88
88
|
|
|
@@ -92,6 +92,6 @@ The standard unified plugin (attacher) function.
|
|
|
92
92
|
|
|
93
93
|
> `optional` **stage**: [`PipelineStage`](../enumerations/PipelineStage.md) \| `"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
94
94
|
|
|
95
|
-
Defined in: [packages/mdast-plus/src/types.ts:48](https://github.com/isdk/mdast-plus.js/blob/
|
|
95
|
+
Defined in: [packages/mdast-plus/src/types.ts:48](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L48)
|
|
96
96
|
|
|
97
97
|
The stage in which this plugin should run.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastSub
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:124](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:124](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L124)
|
|
10
10
|
|
|
11
11
|
Represents a subscript text node in mdast.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Represents a subscript text node in mdast.
|
|
|
20
20
|
|
|
21
21
|
> **children**: `PhrasingContent`[]
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:126](https://github.com/isdk/mdast-plus.js/blob/
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:126](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L126)
|
|
24
24
|
|
|
25
25
|
List of children.
|
|
26
26
|
|
|
@@ -65,7 +65,7 @@ have a position.
|
|
|
65
65
|
|
|
66
66
|
> **type**: `"sub"`
|
|
67
67
|
|
|
68
|
-
Defined in: [packages/mdast-plus/src/types.ts:125](https://github.com/isdk/mdast-plus.js/blob/
|
|
68
|
+
Defined in: [packages/mdast-plus/src/types.ts:125](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L125)
|
|
69
69
|
|
|
70
70
|
Node type.
|
|
71
71
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastSup
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:130](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:130](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L130)
|
|
10
10
|
|
|
11
11
|
Represents a superscript text node in mdast.
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ Represents a superscript text node in mdast.
|
|
|
20
20
|
|
|
21
21
|
> **children**: `PhrasingContent`[]
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:132](https://github.com/isdk/mdast-plus.js/blob/
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:132](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L132)
|
|
24
24
|
|
|
25
25
|
List of children.
|
|
26
26
|
|
|
@@ -65,7 +65,7 @@ have a position.
|
|
|
65
65
|
|
|
66
66
|
> **type**: `"sup"`
|
|
67
67
|
|
|
68
|
-
Defined in: [packages/mdast-plus/src/types.ts:131](https://github.com/isdk/mdast-plus.js/blob/
|
|
68
|
+
Defined in: [packages/mdast-plus/src/types.ts:131](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L131)
|
|
69
69
|
|
|
70
70
|
Node type.
|
|
71
71
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: PipelineRunOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:86](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:86](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L86)
|
|
10
10
|
|
|
11
11
|
Options for controlling the pipeline execution.
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Options for controlling the pipeline execution.
|
|
|
16
16
|
|
|
17
17
|
> `optional` **overrides**: `Record`\<`string`, `any`\>
|
|
18
18
|
|
|
19
|
-
Defined in: [packages/mdast-plus/src/types.ts:101](https://github.com/isdk/mdast-plus.js/blob/
|
|
19
|
+
Defined in: [packages/mdast-plus/src/types.ts:101](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L101)
|
|
20
20
|
|
|
21
21
|
Map of plugin names to their option overrides.
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ Map of plugin names to their option overrides.
|
|
|
26
26
|
|
|
27
27
|
> `optional` **stage**: [`PipelineStage`](../enumerations/PipelineStage.md) \| `"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
28
28
|
|
|
29
|
-
Defined in: [packages/mdast-plus/src/types.ts:91](https://github.com/isdk/mdast-plus.js/blob/
|
|
29
|
+
Defined in: [packages/mdast-plus/src/types.ts:91](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L91)
|
|
30
30
|
|
|
31
31
|
Run the pipeline only up to the specified stage.
|
|
32
32
|
Useful for debugging or inspecting intermediate ASTs.
|
|
@@ -37,7 +37,7 @@ Useful for debugging or inspecting intermediate ASTs.
|
|
|
37
37
|
|
|
38
38
|
> `optional` **stopAtIndex**: `number`
|
|
39
39
|
|
|
40
|
-
Defined in: [packages/mdast-plus/src/types.ts:97](https://github.com/isdk/mdast-plus.js/blob/
|
|
40
|
+
Defined in: [packages/mdast-plus/src/types.ts:97](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L97)
|
|
41
41
|
|
|
42
42
|
If `stage` is specified, stop execution at this index (0-based)
|
|
43
43
|
within the list of plugins at that stage.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: ReadabilityOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:26](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:26](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L26)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:26](https://git
|
|
|
14
14
|
|
|
15
15
|
> `optional` **extraMetadata**: `Record`\<`string`, `any`\>
|
|
16
16
|
|
|
17
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:59](https://github.com/isdk/mdast-plus.js/blob/
|
|
17
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:59](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L59)
|
|
18
18
|
|
|
19
19
|
Extra key-value pairs to inject into the frontmatter.
|
|
20
20
|
These will be merged with the readability metadata.
|
|
@@ -25,7 +25,7 @@ These will be merged with the readability metadata.
|
|
|
25
25
|
|
|
26
26
|
> `optional` **fields**: `string`[] \| `Record`\<`string`, `string`\>
|
|
27
27
|
|
|
28
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:54](https://github.com/isdk/mdast-plus.js/blob/
|
|
28
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:54](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L54)
|
|
29
29
|
|
|
30
30
|
Control the fields and names in metadata.
|
|
31
31
|
- If an array of strings, it acts as an allowlist (only these fields are kept).
|
|
@@ -37,7 +37,7 @@ Control the fields and names in metadata.
|
|
|
37
37
|
|
|
38
38
|
> `optional` **frontmatter**: `boolean` \| `"yaml"` \| `"toml"`
|
|
39
39
|
|
|
40
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:37](https://github.com/isdk/mdast-plus.js/blob/
|
|
40
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:37](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L37)
|
|
41
41
|
|
|
42
42
|
Whether to inject metadata as frontmatter.
|
|
43
43
|
|
|
@@ -53,7 +53,7 @@ false
|
|
|
53
53
|
|
|
54
54
|
> `optional` **hast**: `Record`\<`string`, `any`\>
|
|
55
55
|
|
|
56
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:31](https://github.com/isdk/mdast-plus.js/blob/
|
|
56
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:31](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L31)
|
|
57
57
|
|
|
58
58
|
***
|
|
59
59
|
|
|
@@ -61,7 +61,7 @@ Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:31](https://git
|
|
|
61
61
|
|
|
62
62
|
> `optional` **jsdom**: `Record`\<`string`, `any`\>
|
|
63
63
|
|
|
64
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:30](https://github.com/isdk/mdast-plus.js/blob/
|
|
64
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:30](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L30)
|
|
65
65
|
|
|
66
66
|
***
|
|
67
67
|
|
|
@@ -69,7 +69,7 @@ Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:30](https://git
|
|
|
69
69
|
|
|
70
70
|
> `optional` **readability**: `false` \| `Record`\<`string`, `any`\>
|
|
71
71
|
|
|
72
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:29](https://github.com/isdk/mdast-plus.js/blob/
|
|
72
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:29](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L29)
|
|
73
73
|
|
|
74
74
|
***
|
|
75
75
|
|
|
@@ -77,7 +77,7 @@ Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:29](https://git
|
|
|
77
77
|
|
|
78
78
|
> `optional` **rehype-parse**: `Record`\<`string`, `any`\>
|
|
79
79
|
|
|
80
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:32](https://github.com/isdk/mdast-plus.js/blob/
|
|
80
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:32](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L32)
|
|
81
81
|
|
|
82
82
|
***
|
|
83
83
|
|
|
@@ -85,7 +85,7 @@ Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:32](https://git
|
|
|
85
85
|
|
|
86
86
|
> `optional` **smartExcerpt**: `boolean` \| [`SmartExcerptOptions`](SmartExcerptOptions.md)
|
|
87
87
|
|
|
88
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:48](https://github.com/isdk/mdast-plus.js/blob/
|
|
88
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:48](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L48)
|
|
89
89
|
|
|
90
90
|
Whether to remove the excerpt if it is a duplicate or near-duplicate of the main content.
|
|
91
91
|
Useful when the content is short or the excerpt is just a subset of the content.
|
|
@@ -102,7 +102,7 @@ true
|
|
|
102
102
|
|
|
103
103
|
> `optional` **sourceLink**: `boolean`
|
|
104
104
|
|
|
105
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:42](https://github.com/isdk/mdast-plus.js/blob/
|
|
105
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:42](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L42)
|
|
106
106
|
|
|
107
107
|
Whether to append source link at the bottom.
|
|
108
108
|
|
|
@@ -118,4 +118,4 @@ false
|
|
|
118
118
|
|
|
119
119
|
> `optional` **url**: `string`
|
|
120
120
|
|
|
121
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:28](https://github.com/isdk/mdast-plus.js/blob/
|
|
121
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:28](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L28)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: SmartExcerptOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:11](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:11](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L11)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:11](https://git
|
|
|
14
14
|
|
|
15
15
|
> `optional` **minContentLength**: `number`
|
|
16
16
|
|
|
17
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:23](https://github.com/isdk/mdast-plus.js/blob/
|
|
17
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:23](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L23)
|
|
18
18
|
|
|
19
19
|
The minimum length of the main content required to keep the excerpt.
|
|
20
20
|
If content length is less than this value, the excerpt is considered redundant (if it is contained in the content).
|
|
@@ -31,7 +31,7 @@ If content length is less than this value, the excerpt is considered redundant (
|
|
|
31
31
|
|
|
32
32
|
> `optional` **threshold**: `number`
|
|
33
33
|
|
|
34
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:17](https://github.com/isdk/mdast-plus.js/blob/
|
|
34
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:17](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L17)
|
|
35
35
|
|
|
36
36
|
The threshold ratio of excerpt length to content length.
|
|
37
37
|
If (excerptLength / contentLength) > threshold, the excerpt is considered redundant.
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> **PipelineStageName** = keyof *typeof* [`PipelineStage`](../enumerations/PipelineStage.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/types.ts:27](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/types.ts:27](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L27)
|
|
12
12
|
|
|
13
13
|
String names corresponding to the PipelineStage levels.
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **DefaultPipelineStage**: [`compile`](../enumerations/PipelineStage.md#compile) = `PipelineStage.compile`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/types.ts:24](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/types.ts:24](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/types.ts#L24)
|
|
12
12
|
|
|
13
13
|
The default stage assigned to a plugin if none is specified.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **astFormat**: [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/ast.ts:35](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/ast.ts:35](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/formats/ast.ts#L35)
|
|
12
12
|
|
|
13
13
|
AST (MDAST) format definition.
|
|
14
14
|
Supports reading from JSON strings and provides full normalization
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **htmlFormat**: [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/html.ts:71](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/html.ts:71](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/formats/html.ts#L71)
|
|
12
12
|
|
|
13
13
|
HTML format definition.
|
|
14
14
|
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **htmlReadability**: `Plugin`\<\[[`ReadabilityOptions`](../interfaces/ReadabilityOptions.md)?\], `string`, `Root`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:65](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:65](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L65)
|
|
12
12
|
|
|
13
13
|
A unified/rehype plugin that uses Mozilla's Readability to parse the input HTML.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **htmlReadabilityPlugin**: `object`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:228](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:228](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L228)
|
|
12
12
|
|
|
13
13
|
Pre-configured MdastPlugin for html-readability.
|
|
14
14
|
|
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **htmlReadabilityPlugins**: (\{ `main`: `boolean`; `name`: `string`; `plugin`: `Plugin`\<\[[`ReadabilityOptions`](../interfaces/ReadabilityOptions.md)?\], `string`, `Root`\>; `stage`: [`PipelineStage`](../enumerations/PipelineStage.md); \} \| \{ `after`: `string`; `name`: `string`; `plugin`: (`options?`) => (`tree`, `file`) => `void`; `stage`: [`PipelineStage`](../enumerations/PipelineStage.md); \})[]
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:289](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:289](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L289)
|
|
12
12
|
|
|
13
13
|
Combined plugins for HTML readability.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **markdownFormat**: [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/markdown.ts:103](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/markdown.ts:103](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/formats/markdown.ts#L103)
|
|
12
12
|
|
|
13
13
|
Markdown format definition.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **restoreReadabilityMetaPlugin**: `object`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:240](https://github.com/isdk/mdast-plus.js/blob/
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:240](https://github.com/isdk/mdast-plus.js/blob/5a6a4660c9e58c3f1962ac06703980775afb9c70/src/plugins/html-readability.ts#L240)
|
|
12
12
|
|
|
13
13
|
Plugin to restore readability metadata after HAST to MDAST conversion.
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isdk/mdast-plus",
|
|
3
3
|
"description": "A semantic-first Markdown processing toolkit based on unified, remark, and rehype with a Fluent API and staged plugin system.",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Riceball LEE <snowyu.lee@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/isdk/mdast-plus.js",
|