@isdk/mdast-plus 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.cn.md +69 -22
- package/README.md +69 -22
- package/dist/index.d.mts +564 -199
- package/dist/index.d.ts +564 -199
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +69 -22
- package/docs/_media/CONTRIBUTING.md +53 -24
- package/docs/_media/README.cn.md +69 -22
- package/docs/classes/MdastBasePipeline.md +416 -0
- package/docs/classes/MdastPipeline.md +611 -0
- package/docs/enumerations/PipelineStage.md +62 -0
- package/docs/functions/astCompiler.md +25 -0
- package/docs/functions/jsonParser.md +24 -0
- package/docs/functions/mdast.md +4 -4
- package/docs/globals.md +17 -10
- package/docs/interfaces/MdastDataOrigin.md +8 -8
- package/docs/interfaces/MdastFormat.md +71 -0
- package/docs/interfaces/MdastMark.md +4 -4
- package/docs/interfaces/MdastPlugin.md +57 -25
- package/docs/interfaces/MdastSub.md +4 -4
- package/docs/interfaces/MdastSup.md +4 -4
- package/docs/interfaces/ReadabilityOptions.md +33 -0
- package/docs/type-aliases/PipelineStageName.md +13 -0
- package/docs/variables/DefaultPipelineStage.md +13 -0
- package/docs/variables/astFormat.md +15 -0
- package/docs/variables/htmlFormat.md +6 -4
- package/docs/variables/htmlReadability.md +13 -0
- package/docs/variables/htmlReadabilityPlugin.md +27 -0
- package/docs/variables/htmlReadabilityPlugins.md +13 -0
- package/docs/variables/markdownFormat.md +6 -4
- package/docs/variables/restoreReadabilityMetaPlugin.md +49 -0
- package/package.json +18 -9
- package/docs/classes/FluentProcessor.md +0 -210
- package/docs/functions/htmlStringify.md +0 -23
- package/docs/functions/markdownCommon.md +0 -23
- package/docs/interfaces/ConvertResult.md +0 -39
- package/docs/interfaces/MdastAsset.md +0 -41
- package/docs/interfaces/MdastFormatDefinition.md +0 -51
- package/docs/interfaces/MdastReader.md +0 -41
- package/docs/interfaces/MdastTransformer.md +0 -33
- package/docs/interfaces/MdastWriter.md +0 -47
- package/docs/type-aliases/Stage.md +0 -13
package/docs/functions/mdast.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: mdast()
|
|
8
8
|
|
|
9
|
-
> **mdast**(`input`): [`
|
|
9
|
+
> **mdast**(`input`): [`MdastPipeline`](../classes/MdastPipeline.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/pipeline.ts:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/pipeline.ts:486](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/pipeline.ts#L486)
|
|
12
12
|
|
|
13
13
|
Entry point for the fluent mdast-plus API.
|
|
14
14
|
|
|
@@ -16,12 +16,12 @@ Entry point for the fluent mdast-plus API.
|
|
|
16
16
|
|
|
17
17
|
### input
|
|
18
18
|
|
|
19
|
-
`
|
|
19
|
+
`Compatible`
|
|
20
20
|
|
|
21
21
|
The input content (string or mdast tree)
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
25
|
-
[`
|
|
25
|
+
[`MdastPipeline`](../classes/MdastPipeline.md)
|
|
26
26
|
|
|
27
27
|
A FluentProcessor instance
|
package/docs/globals.md
CHANGED
|
@@ -4,35 +4,42 @@
|
|
|
4
4
|
|
|
5
5
|
# @isdk/mdast-plus
|
|
6
6
|
|
|
7
|
+
## Enumerations
|
|
8
|
+
|
|
9
|
+
- [PipelineStage](enumerations/PipelineStage.md)
|
|
10
|
+
|
|
7
11
|
## Classes
|
|
8
12
|
|
|
9
|
-
- [
|
|
13
|
+
- [MdastBasePipeline](classes/MdastBasePipeline.md)
|
|
14
|
+
- [MdastPipeline](classes/MdastPipeline.md)
|
|
10
15
|
|
|
11
16
|
## Interfaces
|
|
12
17
|
|
|
13
|
-
- [ConvertResult](interfaces/ConvertResult.md)
|
|
14
|
-
- [MdastAsset](interfaces/MdastAsset.md)
|
|
15
18
|
- [MdastDataOrigin](interfaces/MdastDataOrigin.md)
|
|
16
|
-
- [
|
|
19
|
+
- [MdastFormat](interfaces/MdastFormat.md)
|
|
17
20
|
- [MdastMark](interfaces/MdastMark.md)
|
|
18
21
|
- [MdastPlugin](interfaces/MdastPlugin.md)
|
|
19
|
-
- [MdastReader](interfaces/MdastReader.md)
|
|
20
22
|
- [MdastSub](interfaces/MdastSub.md)
|
|
21
23
|
- [MdastSup](interfaces/MdastSup.md)
|
|
22
|
-
- [
|
|
23
|
-
- [MdastWriter](interfaces/MdastWriter.md)
|
|
24
|
+
- [ReadabilityOptions](interfaces/ReadabilityOptions.md)
|
|
24
25
|
|
|
25
26
|
## Type Aliases
|
|
26
27
|
|
|
27
|
-
- [
|
|
28
|
+
- [PipelineStageName](type-aliases/PipelineStageName.md)
|
|
28
29
|
|
|
29
30
|
## Variables
|
|
30
31
|
|
|
32
|
+
- [astFormat](variables/astFormat.md)
|
|
33
|
+
- [DefaultPipelineStage](variables/DefaultPipelineStage.md)
|
|
31
34
|
- [htmlFormat](variables/htmlFormat.md)
|
|
35
|
+
- [htmlReadability](variables/htmlReadability.md)
|
|
36
|
+
- [htmlReadabilityPlugin](variables/htmlReadabilityPlugin.md)
|
|
37
|
+
- [htmlReadabilityPlugins](variables/htmlReadabilityPlugins.md)
|
|
32
38
|
- [markdownFormat](variables/markdownFormat.md)
|
|
39
|
+
- [restoreReadabilityMetaPlugin](variables/restoreReadabilityMetaPlugin.md)
|
|
33
40
|
|
|
34
41
|
## Functions
|
|
35
42
|
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
43
|
+
- [astCompiler](functions/astCompiler.md)
|
|
44
|
+
- [jsonParser](functions/jsonParser.md)
|
|
38
45
|
- [mdast](functions/mdast.md)
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastDataOrigin
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:86](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L86)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Metadata capturing the origin of a node during conversion.
|
|
12
12
|
|
|
13
13
|
## Indexable
|
|
14
14
|
|
|
@@ -20,9 +20,9 @@ Original metadata for a node.
|
|
|
20
20
|
|
|
21
21
|
> **format**: `string`
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:88](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L88)
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The original source format.
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
@@ -30,9 +30,9 @@ Source format
|
|
|
30
30
|
|
|
31
31
|
> `optional` **hash**: `string`
|
|
32
32
|
|
|
33
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
33
|
+
Defined in: [packages/mdast-plus/src/types.ts:92](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L92)
|
|
34
34
|
|
|
35
|
-
Hash
|
|
35
|
+
Hash used for caching or change detection.
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
@@ -40,6 +40,6 @@ Hash of the source content
|
|
|
40
40
|
|
|
41
41
|
> `optional` **raw**: `unknown`
|
|
42
42
|
|
|
43
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
43
|
+
Defined in: [packages/mdast-plus/src/types.ts:90](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L90)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The raw content from the source before conversion.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / MdastFormat
|
|
6
|
+
|
|
7
|
+
# Interface: MdastFormat
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:66](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L66)
|
|
10
|
+
|
|
11
|
+
Defines a document format, encompassing its input (parsing) and output (serialization) strategies.
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
### extensions?
|
|
16
|
+
|
|
17
|
+
> `optional` **extensions**: `string`[]
|
|
18
|
+
|
|
19
|
+
Defined in: [packages/mdast-plus/src/types.ts:72](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L72)
|
|
20
|
+
|
|
21
|
+
File extensions associated with this format.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### id
|
|
26
|
+
|
|
27
|
+
> **id**: `string`
|
|
28
|
+
|
|
29
|
+
Defined in: [packages/mdast-plus/src/types.ts:68](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L68)
|
|
30
|
+
|
|
31
|
+
Unique identifier for the format (e.g., 'markdown', 'html').
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### input?
|
|
36
|
+
|
|
37
|
+
> `optional` **input**: [`MdastPlugin`](MdastPlugin.md)[]
|
|
38
|
+
|
|
39
|
+
Defined in: [packages/mdast-plus/src/types.ts:77](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L77)
|
|
40
|
+
|
|
41
|
+
Plugins used for reading this format into a standard AST (Parser + Normalizer).
|
|
42
|
+
|
|
43
|
+
***
|
|
44
|
+
|
|
45
|
+
### mediaTypes?
|
|
46
|
+
|
|
47
|
+
> `optional` **mediaTypes**: `string`[]
|
|
48
|
+
|
|
49
|
+
Defined in: [packages/mdast-plus/src/types.ts:74](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L74)
|
|
50
|
+
|
|
51
|
+
MIME types associated with this format.
|
|
52
|
+
|
|
53
|
+
***
|
|
54
|
+
|
|
55
|
+
### output?
|
|
56
|
+
|
|
57
|
+
> `optional` **output**: [`MdastPlugin`](MdastPlugin.md)[]
|
|
58
|
+
|
|
59
|
+
Defined in: [packages/mdast-plus/src/types.ts:80](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L80)
|
|
60
|
+
|
|
61
|
+
Plugins used for serializing the AST into this format (Finalizer + Stringifier).
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### title?
|
|
66
|
+
|
|
67
|
+
> `optional` **title**: `string`
|
|
68
|
+
|
|
69
|
+
Defined in: [packages/mdast-plus/src/types.ts:70](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L70)
|
|
70
|
+
|
|
71
|
+
Human-readable title.
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastMark
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:97](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L97)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Represents a highlighted text (mark) node in mdast.
|
|
12
12
|
|
|
13
13
|
## Extends
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ mdast node for highlighted text (mark).
|
|
|
20
20
|
|
|
21
21
|
> **children**: `PhrasingContent`[]
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:99](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L99)
|
|
24
24
|
|
|
25
25
|
List of children.
|
|
26
26
|
|
|
@@ -65,7 +65,7 @@ have a position.
|
|
|
65
65
|
|
|
66
66
|
> **type**: `"mark"`
|
|
67
67
|
|
|
68
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
68
|
+
Defined in: [packages/mdast-plus/src/types.ts:98](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L98)
|
|
69
69
|
|
|
70
70
|
Node type.
|
|
71
71
|
|
|
@@ -6,60 +6,92 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastPlugin
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:33](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L33)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Configuration for a plugin within the mdast-plus pipeline.
|
|
12
|
+
It wraps a standard unified plugin with execution metadata.
|
|
12
13
|
|
|
13
14
|
## Properties
|
|
14
15
|
|
|
15
|
-
###
|
|
16
|
+
### after?
|
|
16
17
|
|
|
17
|
-
> **
|
|
18
|
+
> `optional` **after**: `string`
|
|
18
19
|
|
|
19
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
20
|
+
Defined in: [packages/mdast-plus/src/types.ts:60](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L60)
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
Run this plugin after the named plugin (within the same stage).
|
|
22
23
|
|
|
23
24
|
***
|
|
24
25
|
|
|
25
|
-
###
|
|
26
|
+
### before?
|
|
26
27
|
|
|
27
|
-
> `optional` **
|
|
28
|
+
> `optional` **before**: `string`
|
|
28
29
|
|
|
29
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
30
|
+
Defined in: [packages/mdast-plus/src/types.ts:58](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L58)
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
Run this plugin before the named plugin (within the same stage).
|
|
32
33
|
|
|
33
34
|
***
|
|
34
35
|
|
|
35
|
-
###
|
|
36
|
+
### main?
|
|
37
|
+
|
|
38
|
+
> `optional` **main**: `boolean`
|
|
39
|
+
|
|
40
|
+
Defined in: [packages/mdast-plus/src/types.ts:56](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L56)
|
|
41
|
+
|
|
42
|
+
If true, this plugin is considered the "main" plugin for its stage.
|
|
43
|
+
When multiple plugins exist in the same stage, a 'main' plugin will
|
|
44
|
+
replace the default (first) plugin of that stage.
|
|
36
45
|
|
|
37
|
-
|
|
46
|
+
***
|
|
47
|
+
|
|
48
|
+
### name?
|
|
49
|
+
|
|
50
|
+
> `optional` **name**: `string`
|
|
38
51
|
|
|
39
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
52
|
+
Defined in: [packages/mdast-plus/src/types.ts:39](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L39)
|
|
40
53
|
|
|
41
|
-
|
|
54
|
+
Optional name for the plugin.
|
|
55
|
+
Used for identification in overrides and logging.
|
|
56
|
+
If not provided, defaults to the plugin function's name.
|
|
42
57
|
|
|
43
58
|
***
|
|
44
59
|
|
|
45
|
-
###
|
|
60
|
+
### options?
|
|
46
61
|
|
|
47
|
-
>
|
|
62
|
+
> `optional` **options**: `any`[]
|
|
48
63
|
|
|
49
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
64
|
+
Defined in: [packages/mdast-plus/src/types.ts:46](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L46)
|
|
50
65
|
|
|
51
|
-
|
|
66
|
+
Arguments passed to the plugin.
|
|
67
|
+
MUST be an array of arguments (e.g., [optionsObject]).
|
|
52
68
|
|
|
53
|
-
|
|
69
|
+
***
|
|
54
70
|
|
|
55
|
-
|
|
71
|
+
### order?
|
|
56
72
|
|
|
57
|
-
`
|
|
73
|
+
> `optional` **order**: `number`
|
|
58
74
|
|
|
59
|
-
|
|
75
|
+
Defined in: [packages/mdast-plus/src/types.ts:50](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L50)
|
|
76
|
+
|
|
77
|
+
Execution priority within the same stage. Lower values run earlier.
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### plugin
|
|
82
|
+
|
|
83
|
+
> **plugin**: `Plugin`\<`any`[], `any`, `any`\>
|
|
84
|
+
|
|
85
|
+
Defined in: [packages/mdast-plus/src/types.ts:41](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L41)
|
|
86
|
+
|
|
87
|
+
The standard unified plugin (attacher) function.
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### stage?
|
|
60
92
|
|
|
61
|
-
`
|
|
93
|
+
> `optional` **stage**: [`PipelineStage`](../enumerations/PipelineStage.md) \| `"parse"` \| `"normalize"` \| `"compile"` \| `"finalize"` \| `"stringify"`
|
|
62
94
|
|
|
63
|
-
|
|
95
|
+
Defined in: [packages/mdast-plus/src/types.ts:48](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L48)
|
|
64
96
|
|
|
65
|
-
|
|
97
|
+
The stage in which this plugin should run.
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastSub
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:103](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L103)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Represents a subscript text node in mdast.
|
|
12
12
|
|
|
13
13
|
## Extends
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ mdast node for subscript text.
|
|
|
20
20
|
|
|
21
21
|
> **children**: `PhrasingContent`[]
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:105](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L105)
|
|
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:
|
|
68
|
+
Defined in: [packages/mdast-plus/src/types.ts:104](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L104)
|
|
69
69
|
|
|
70
70
|
Node type.
|
|
71
71
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: MdastSup
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
9
|
+
Defined in: [packages/mdast-plus/src/types.ts:109](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L109)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Represents a superscript text node in mdast.
|
|
12
12
|
|
|
13
13
|
## Extends
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ mdast node for superscript text.
|
|
|
20
20
|
|
|
21
21
|
> **children**: `PhrasingContent`[]
|
|
22
22
|
|
|
23
|
-
Defined in: [packages/mdast-plus/src/types.ts:
|
|
23
|
+
Defined in: [packages/mdast-plus/src/types.ts:111](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L111)
|
|
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:
|
|
68
|
+
Defined in: [packages/mdast-plus/src/types.ts:110](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L110)
|
|
69
69
|
|
|
70
70
|
Node type.
|
|
71
71
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / ReadabilityOptions
|
|
6
|
+
|
|
7
|
+
# Interface: ReadabilityOptions
|
|
8
|
+
|
|
9
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:6](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L6)
|
|
10
|
+
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
### enable?
|
|
14
|
+
|
|
15
|
+
> `optional` **enable**: `boolean`
|
|
16
|
+
|
|
17
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:7](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L7)
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### jsdom?
|
|
22
|
+
|
|
23
|
+
> `optional` **jsdom**: `Record`\<`string`, `any`\>
|
|
24
|
+
|
|
25
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:9](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L9)
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### readability?
|
|
30
|
+
|
|
31
|
+
> `optional` **readability**: `Record`\<`string`, `any`\>
|
|
32
|
+
|
|
33
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:8](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L8)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / PipelineStageName
|
|
6
|
+
|
|
7
|
+
# Type Alias: PipelineStageName
|
|
8
|
+
|
|
9
|
+
> **PipelineStageName** = keyof *typeof* [`PipelineStage`](../enumerations/PipelineStage.md)
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/mdast-plus/src/types.ts:27](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L27)
|
|
12
|
+
|
|
13
|
+
String names corresponding to the PipelineStage levels.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / DefaultPipelineStage
|
|
6
|
+
|
|
7
|
+
# Variable: DefaultPipelineStage
|
|
8
|
+
|
|
9
|
+
> `const` **DefaultPipelineStage**: [`compile`](../enumerations/PipelineStage.md#compile) = `PipelineStage.compile`
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/mdast-plus/src/types.ts:24](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/types.ts#L24)
|
|
12
|
+
|
|
13
|
+
The default stage assigned to a plugin if none is specified.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / astFormat
|
|
6
|
+
|
|
7
|
+
# Variable: astFormat
|
|
8
|
+
|
|
9
|
+
> `const` **astFormat**: [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/ast.ts:35](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/formats/ast.ts#L35)
|
|
12
|
+
|
|
13
|
+
AST (MDAST) format definition.
|
|
14
|
+
Supports reading from JSON strings and provides full normalization
|
|
15
|
+
through the standard mdast-plus plugin set.
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
# Variable: htmlFormat
|
|
8
8
|
|
|
9
|
-
> `const` **htmlFormat**: [`
|
|
9
|
+
> `const` **htmlFormat**: [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/html.ts:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/html.ts:71](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/formats/html.ts#L71)
|
|
12
12
|
|
|
13
|
-
HTML format definition
|
|
14
|
-
|
|
13
|
+
HTML format definition.
|
|
14
|
+
|
|
15
|
+
Provides a bidirectional mapping between HTML strings and mdast-plus ASTs.
|
|
16
|
+
Includes built-in sanitization and support for table spans and image dimensions.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / htmlReadability
|
|
6
|
+
|
|
7
|
+
# Variable: htmlReadability
|
|
8
|
+
|
|
9
|
+
> `const` **htmlReadability**: `Plugin`\<\[([`ReadabilityOptions`](../interfaces/ReadabilityOptions.md) \| `boolean`)?\], `string`, `Root`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:15](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L15)
|
|
12
|
+
|
|
13
|
+
A unified/rehype plugin that uses Mozilla's Readability to parse the input HTML.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / htmlReadabilityPlugin
|
|
6
|
+
|
|
7
|
+
# Variable: htmlReadabilityPlugin
|
|
8
|
+
|
|
9
|
+
> `const` **htmlReadabilityPlugin**: `object`
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:77](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L77)
|
|
12
|
+
|
|
13
|
+
Pre-configured MdastPlugin for html-readability.
|
|
14
|
+
|
|
15
|
+
## Type Declaration
|
|
16
|
+
|
|
17
|
+
### name
|
|
18
|
+
|
|
19
|
+
> **name**: `string` = `'readability'`
|
|
20
|
+
|
|
21
|
+
### plugin
|
|
22
|
+
|
|
23
|
+
> **plugin**: `Plugin`\<\[(`boolean` \| [`ReadabilityOptions`](../interfaces/ReadabilityOptions.md))?\], `string`, `Root`\> = `htmlReadability`
|
|
24
|
+
|
|
25
|
+
### stage
|
|
26
|
+
|
|
27
|
+
> **stage**: [`PipelineStage`](../enumerations/PipelineStage.md) = `PipelineStage.parse`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / htmlReadabilityPlugins
|
|
6
|
+
|
|
7
|
+
# Variable: htmlReadabilityPlugins
|
|
8
|
+
|
|
9
|
+
> `const` **htmlReadabilityPlugins**: (\{ `name`: `string`; `plugin`: `Plugin`\<\[(`boolean` \| [`ReadabilityOptions`](../interfaces/ReadabilityOptions.md))?\], `string`, `Root`\>; `stage`: [`PipelineStage`](../enumerations/PipelineStage.md); \} \| \{ `after`: `string`; `name`: `string`; `plugin`: () => (`tree`, `file`) => `void`; `stage`: [`PipelineStage`](../enumerations/PipelineStage.md); \})[]
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:103](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L103)
|
|
12
|
+
|
|
13
|
+
Combined plugins for HTML readability.
|
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
# Variable: markdownFormat
|
|
8
8
|
|
|
9
|
-
> `const` **markdownFormat**: [`
|
|
9
|
+
> `const` **markdownFormat**: [`MdastFormat`](../interfaces/MdastFormat.md)
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/markdown.ts:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/formats/markdown.ts:103](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/formats/markdown.ts#L103)
|
|
12
12
|
|
|
13
|
-
Markdown format definition
|
|
14
|
-
|
|
13
|
+
Markdown format definition.
|
|
14
|
+
|
|
15
|
+
Supports GFM, Directives, Math, and Frontmatter.
|
|
16
|
+
Provides a bidirectional mapping between Markdown strings and mdast-plus ASTs.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/mdast-plus](../globals.md) / restoreReadabilityMetaPlugin
|
|
6
|
+
|
|
7
|
+
# Variable: restoreReadabilityMetaPlugin
|
|
8
|
+
|
|
9
|
+
> `const` **restoreReadabilityMetaPlugin**: `object`
|
|
10
|
+
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:88](https://github.com/isdk/mdast-plus.js/blob/8870eec4ef97dd48bead818813d06479ceff9450/src/plugins/html-readability.ts#L88)
|
|
12
|
+
|
|
13
|
+
Plugin to restore readability metadata after HAST to MDAST conversion.
|
|
14
|
+
|
|
15
|
+
## Type Declaration
|
|
16
|
+
|
|
17
|
+
### after
|
|
18
|
+
|
|
19
|
+
> **after**: `string` = `'rehype-remark'`
|
|
20
|
+
|
|
21
|
+
### name
|
|
22
|
+
|
|
23
|
+
> **name**: `string` = `'restore-readability-meta'`
|
|
24
|
+
|
|
25
|
+
### plugin()
|
|
26
|
+
|
|
27
|
+
> **plugin**: () => (`tree`, `file`) => `void`
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
> (`tree`, `file`): `void`
|
|
32
|
+
|
|
33
|
+
##### Parameters
|
|
34
|
+
|
|
35
|
+
###### tree
|
|
36
|
+
|
|
37
|
+
`any`
|
|
38
|
+
|
|
39
|
+
###### file
|
|
40
|
+
|
|
41
|
+
`any`
|
|
42
|
+
|
|
43
|
+
##### Returns
|
|
44
|
+
|
|
45
|
+
`void`
|
|
46
|
+
|
|
47
|
+
### stage
|
|
48
|
+
|
|
49
|
+
> **stage**: [`PipelineStage`](../enumerations/PipelineStage.md) = `PipelineStage.parse`
|