@isdk/mdast-plus 0.2.0 → 0.2.1
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 +2 -0
- package/README.md +2 -0
- package/dist/index.d.mts +22 -9
- package/dist/index.d.ts +22 -9
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +2 -0
- package/docs/_media/CONTRIBUTING.md +2 -0
- package/docs/_media/README.cn.md +2 -0
- package/docs/classes/MdastBasePipeline.md +52 -20
- package/docs/classes/MdastPipeline.md +65 -29
- package/docs/enumerations/PipelineStage.md +6 -6
- package/docs/functions/astCompiler.md +1 -1
- package/docs/functions/jsonParser.md +1 -1
- package/docs/functions/mdast.md +1 -1
- package/docs/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/ReadabilityOptions.md +18 -10
- package/docs/type-aliases/PipelineStageName.md +1 -1
- package/docs/variables/DefaultPipelineStage.md +1 -1
- package/docs/variables/astFormat.md +1 -1
- package/docs/variables/htmlFormat.md +1 -1
- package/docs/variables/htmlReadability.md +2 -2
- package/docs/variables/htmlReadabilityPlugin.md +6 -2
- package/docs/variables/htmlReadabilityPlugins.md +2 -2
- package/docs/variables/markdownFormat.md +1 -1
- package/docs/variables/restoreReadabilityMetaPlugin.md +1 -1
- package/package.json +1 -1
|
@@ -6,28 +6,36 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: ReadabilityOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:6](https://github.com/isdk/mdast-plus.js/blob/
|
|
9
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:6](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L6)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### jsdom?
|
|
14
14
|
|
|
15
|
-
> `optional` **
|
|
15
|
+
> `optional` **jsdom**: `Record`\<`string`, `any`\>
|
|
16
16
|
|
|
17
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:
|
|
17
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:10](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L10)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### readability?
|
|
22
22
|
|
|
23
|
-
> `optional` **
|
|
23
|
+
> `optional` **readability**: `false` \| `Record`\<`string`, `any`\>
|
|
24
24
|
|
|
25
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:9](https://github.com/isdk/mdast-plus.js/blob/
|
|
25
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:9](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L9)
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### rehype-parse?
|
|
30
|
+
|
|
31
|
+
> `optional` **rehype-parse**: `Record`\<`string`, `any`\>
|
|
32
|
+
|
|
33
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:11](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L11)
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### url?
|
|
30
38
|
|
|
31
|
-
> `optional` **
|
|
39
|
+
> `optional` **url**: `string`
|
|
32
40
|
|
|
33
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:8](https://github.com/isdk/mdast-plus.js/blob/
|
|
41
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:8](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L8)
|
|
@@ -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/becb4bdeb4b577bd75c7751367751e84056ff87e/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/becb4bdeb4b577bd75c7751367751e84056ff87e/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/becb4bdeb4b577bd75c7751367751e84056ff87e/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/becb4bdeb4b577bd75c7751367751e84056ff87e/src/formats/html.ts#L71)
|
|
12
12
|
|
|
13
13
|
HTML format definition.
|
|
14
14
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
# Variable: htmlReadability
|
|
8
8
|
|
|
9
|
-
> `const` **htmlReadability**: `Plugin`\<\[
|
|
9
|
+
> `const` **htmlReadability**: `Plugin`\<\[[`ReadabilityOptions`](../interfaces/ReadabilityOptions.md)?\], `string`, `Root`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:17](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L17)
|
|
12
12
|
|
|
13
13
|
A unified/rehype plugin that uses Mozilla's Readability to parse the input HTML.
|
|
@@ -8,19 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
> `const` **htmlReadabilityPlugin**: `object`
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:79](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L79)
|
|
12
12
|
|
|
13
13
|
Pre-configured MdastPlugin for html-readability.
|
|
14
14
|
|
|
15
15
|
## Type Declaration
|
|
16
16
|
|
|
17
|
+
### main
|
|
18
|
+
|
|
19
|
+
> **main**: `boolean` = `true`
|
|
20
|
+
|
|
17
21
|
### name
|
|
18
22
|
|
|
19
23
|
> **name**: `string` = `'readability'`
|
|
20
24
|
|
|
21
25
|
### plugin
|
|
22
26
|
|
|
23
|
-
> **plugin**: `Plugin`\<\[
|
|
27
|
+
> **plugin**: `Plugin`\<\[[`ReadabilityOptions`](../interfaces/ReadabilityOptions.md)?\], `string`, `Root`\> = `htmlReadability`
|
|
24
28
|
|
|
25
29
|
### stage
|
|
26
30
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
# Variable: htmlReadabilityPlugins
|
|
8
8
|
|
|
9
|
-
> `const` **htmlReadabilityPlugins**: (\{ `name`: `string`; `plugin`: `Plugin`\<\[
|
|
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`: () => (`tree`, `file`) => `void`; `stage`: [`PipelineStage`](../enumerations/PipelineStage.md); \})[]
|
|
10
10
|
|
|
11
|
-
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:106](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L106)
|
|
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/becb4bdeb4b577bd75c7751367751e84056ff87e/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:
|
|
11
|
+
Defined in: [packages/mdast-plus/src/plugins/html-readability.ts:91](https://github.com/isdk/mdast-plus.js/blob/becb4bdeb4b577bd75c7751367751e84056ff87e/src/plugins/html-readability.ts#L91)
|
|
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.2.
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Riceball LEE <snowyu.lee@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/isdk/mdast-plus.js",
|