@isdk/mdast-plus 0.3.2 → 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.
Files changed (35) hide show
  1. package/README.cn.md +15 -0
  2. package/README.md +15 -0
  3. package/dist/index.d.mts +5 -0
  4. package/dist/index.d.ts +5 -0
  5. package/dist/index.js +1 -1
  6. package/dist/index.mjs +1 -1
  7. package/docs/README.md +15 -0
  8. package/docs/_media/README.cn.md +15 -0
  9. package/docs/classes/MdastBasePipeline.md +20 -20
  10. package/docs/classes/MdastPipeline.md +54 -28
  11. package/docs/enumerations/PipelineStage.md +6 -6
  12. package/docs/functions/astCompiler.md +1 -1
  13. package/docs/functions/checkHtmlUrlExists.md +1 -1
  14. package/docs/functions/checkUrlExists.md +1 -1
  15. package/docs/functions/jsonParser.md +1 -1
  16. package/docs/functions/mdast.md +1 -1
  17. package/docs/interfaces/MdastDataOrigin.md +4 -4
  18. package/docs/interfaces/MdastFormat.md +7 -7
  19. package/docs/interfaces/MdastMark.md +3 -3
  20. package/docs/interfaces/MdastPlugin.md +9 -9
  21. package/docs/interfaces/MdastSub.md +3 -3
  22. package/docs/interfaces/MdastSup.md +3 -3
  23. package/docs/interfaces/PipelineRunOptions.md +4 -4
  24. package/docs/interfaces/ReadabilityOptions.md +11 -11
  25. package/docs/interfaces/SmartExcerptOptions.md +3 -3
  26. package/docs/type-aliases/PipelineStageName.md +1 -1
  27. package/docs/variables/DefaultPipelineStage.md +1 -1
  28. package/docs/variables/astFormat.md +1 -1
  29. package/docs/variables/htmlFormat.md +1 -1
  30. package/docs/variables/htmlReadability.md +1 -1
  31. package/docs/variables/htmlReadabilityPlugin.md +1 -1
  32. package/docs/variables/htmlReadabilityPlugins.md +1 -1
  33. package/docs/variables/markdownFormat.md +1 -1
  34. package/docs/variables/restoreReadabilityMetaPlugin.md +1 -1
  35. package/package.json +1 -1
@@ -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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/types.ts#L86)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/types.ts#L101)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/types.ts#L91)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/types.ts#L97)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L26)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L59)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L54)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L37)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L31)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L30)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L29)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L32)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L48)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L42)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L28)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L11)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L23)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L17)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/types.ts#L27)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/types.ts#L24)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/formats/ast.ts#L35)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/formats/html.ts#L71)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L65)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L228)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L289)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/formats/markdown.ts#L103)
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/6a398ff355b39ed17183d5afad29bd4ca7551ec6/src/plugins/html-readability.ts#L240)
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.2",
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",