@isdk/mdast-plus 0.1.2 → 0.1.3
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 +54 -20
- package/README.md +54 -20
- package/dist/index.d.mts +187 -133
- package/dist/index.d.ts +187 -133
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/README.md +54 -20
- package/docs/_media/CONTRIBUTING.md +39 -18
- package/docs/_media/README.cn.md +54 -20
- package/docs/classes/MdastBasePipeline.md +348 -0
- package/docs/classes/MdastPipeline.md +531 -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 +12 -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 +27 -27
- package/docs/interfaces/MdastSub.md +4 -4
- package/docs/interfaces/MdastSup.md +4 -4
- 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/markdownFormat.md +6 -4
- package/package.json +11 -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
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / markdownCommon
|
|
6
|
-
|
|
7
|
-
# Function: markdownCommon()
|
|
8
|
-
|
|
9
|
-
> **markdownCommon**(`this`): `void`
|
|
10
|
-
|
|
11
|
-
Defined in: [packages/mdast-plus/src/formats/markdown.ts:13](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/formats/markdown.ts#L13)
|
|
12
|
-
|
|
13
|
-
Common remark configuration for Markdown.
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
### this
|
|
18
|
-
|
|
19
|
-
`any`
|
|
20
|
-
|
|
21
|
-
## Returns
|
|
22
|
-
|
|
23
|
-
`void`
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / ConvertResult
|
|
6
|
-
|
|
7
|
-
# Interface: ConvertResult\<T\>
|
|
8
|
-
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:50](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L50)
|
|
10
|
-
|
|
11
|
-
Result of a conversion process.
|
|
12
|
-
|
|
13
|
-
## Type Parameters
|
|
14
|
-
|
|
15
|
-
### T
|
|
16
|
-
|
|
17
|
-
`T` = `string`
|
|
18
|
-
|
|
19
|
-
The type of the main content (default: string)
|
|
20
|
-
|
|
21
|
-
## Properties
|
|
22
|
-
|
|
23
|
-
### assets
|
|
24
|
-
|
|
25
|
-
> **assets**: [`MdastAsset`](MdastAsset.md)[]
|
|
26
|
-
|
|
27
|
-
Defined in: [packages/mdast-plus/src/types.ts:54](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L54)
|
|
28
|
-
|
|
29
|
-
Extracted assets
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
|
-
### content
|
|
34
|
-
|
|
35
|
-
> **content**: `T`
|
|
36
|
-
|
|
37
|
-
Defined in: [packages/mdast-plus/src/types.ts:52](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L52)
|
|
38
|
-
|
|
39
|
-
The converted content
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / MdastAsset
|
|
6
|
-
|
|
7
|
-
# Interface: MdastAsset
|
|
8
|
-
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:37](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L37)
|
|
10
|
-
|
|
11
|
-
Represents an asset (e.g., image) extracted during processing.
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
### bytes
|
|
16
|
-
|
|
17
|
-
> **bytes**: `Uint8Array`
|
|
18
|
-
|
|
19
|
-
Defined in: [packages/mdast-plus/src/types.ts:43](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L43)
|
|
20
|
-
|
|
21
|
-
Raw content as bytes
|
|
22
|
-
|
|
23
|
-
***
|
|
24
|
-
|
|
25
|
-
### contentType
|
|
26
|
-
|
|
27
|
-
> **contentType**: `string`
|
|
28
|
-
|
|
29
|
-
Defined in: [packages/mdast-plus/src/types.ts:41](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L41)
|
|
30
|
-
|
|
31
|
-
MIME type of the asset
|
|
32
|
-
|
|
33
|
-
***
|
|
34
|
-
|
|
35
|
-
### path
|
|
36
|
-
|
|
37
|
-
> **path**: `string`
|
|
38
|
-
|
|
39
|
-
Defined in: [packages/mdast-plus/src/types.ts:39](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L39)
|
|
40
|
-
|
|
41
|
-
Relative path or identifier for the asset
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / MdastFormatDefinition
|
|
6
|
-
|
|
7
|
-
# Interface: MdastFormatDefinition
|
|
8
|
-
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:27](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L27)
|
|
10
|
-
|
|
11
|
-
Definition for an mdast format (parser/stringifier).
|
|
12
|
-
|
|
13
|
-
## Properties
|
|
14
|
-
|
|
15
|
-
### parse()?
|
|
16
|
-
|
|
17
|
-
> `optional` **parse**: (`processor`) => `void`
|
|
18
|
-
|
|
19
|
-
Defined in: [packages/mdast-plus/src/types.ts:29](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L29)
|
|
20
|
-
|
|
21
|
-
Function to register parser plugins
|
|
22
|
-
|
|
23
|
-
#### Parameters
|
|
24
|
-
|
|
25
|
-
##### processor
|
|
26
|
-
|
|
27
|
-
`any`
|
|
28
|
-
|
|
29
|
-
#### Returns
|
|
30
|
-
|
|
31
|
-
`void`
|
|
32
|
-
|
|
33
|
-
***
|
|
34
|
-
|
|
35
|
-
### stringify()?
|
|
36
|
-
|
|
37
|
-
> `optional` **stringify**: (`processor`) => `void`
|
|
38
|
-
|
|
39
|
-
Defined in: [packages/mdast-plus/src/types.ts:31](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L31)
|
|
40
|
-
|
|
41
|
-
Function to register stringifier plugins
|
|
42
|
-
|
|
43
|
-
#### Parameters
|
|
44
|
-
|
|
45
|
-
##### processor
|
|
46
|
-
|
|
47
|
-
`any`
|
|
48
|
-
|
|
49
|
-
#### Returns
|
|
50
|
-
|
|
51
|
-
`void`
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / MdastReader
|
|
6
|
-
|
|
7
|
-
# Interface: MdastReader\<I\>
|
|
8
|
-
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:131](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L131)
|
|
10
|
-
|
|
11
|
-
Interface for reading input into an mdast tree.
|
|
12
|
-
|
|
13
|
-
## Type Parameters
|
|
14
|
-
|
|
15
|
-
### I
|
|
16
|
-
|
|
17
|
-
`I`
|
|
18
|
-
|
|
19
|
-
Input type
|
|
20
|
-
|
|
21
|
-
## Methods
|
|
22
|
-
|
|
23
|
-
### read()
|
|
24
|
-
|
|
25
|
-
> **read**(`input`): `Promise`\<`Root`\>
|
|
26
|
-
|
|
27
|
-
Defined in: [packages/mdast-plus/src/types.ts:136](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L136)
|
|
28
|
-
|
|
29
|
-
Reads input and returns an mdast Root node.
|
|
30
|
-
|
|
31
|
-
#### Parameters
|
|
32
|
-
|
|
33
|
-
##### input
|
|
34
|
-
|
|
35
|
-
`I`
|
|
36
|
-
|
|
37
|
-
The input to read
|
|
38
|
-
|
|
39
|
-
#### Returns
|
|
40
|
-
|
|
41
|
-
`Promise`\<`Root`\>
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / MdastTransformer
|
|
6
|
-
|
|
7
|
-
# Interface: MdastTransformer
|
|
8
|
-
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:142](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L142)
|
|
10
|
-
|
|
11
|
-
Interface for transforming an mdast tree.
|
|
12
|
-
|
|
13
|
-
## Methods
|
|
14
|
-
|
|
15
|
-
### transform()
|
|
16
|
-
|
|
17
|
-
> **transform**(`tree`): `Promise`\<\{ `assets?`: [`MdastAsset`](MdastAsset.md)[]; `tree`: `Root`; \}\>
|
|
18
|
-
|
|
19
|
-
Defined in: [packages/mdast-plus/src/types.ts:147](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L147)
|
|
20
|
-
|
|
21
|
-
Transforms the given mdast tree.
|
|
22
|
-
|
|
23
|
-
#### Parameters
|
|
24
|
-
|
|
25
|
-
##### tree
|
|
26
|
-
|
|
27
|
-
`Root`
|
|
28
|
-
|
|
29
|
-
The Root node to transform
|
|
30
|
-
|
|
31
|
-
#### Returns
|
|
32
|
-
|
|
33
|
-
`Promise`\<\{ `assets?`: [`MdastAsset`](MdastAsset.md)[]; `tree`: `Root`; \}\>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / MdastWriter
|
|
6
|
-
|
|
7
|
-
# Interface: MdastWriter\<Output\>
|
|
8
|
-
|
|
9
|
-
Defined in: [packages/mdast-plus/src/types.ts:154](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L154)
|
|
10
|
-
|
|
11
|
-
Interface for writing an mdast tree to an output format.
|
|
12
|
-
|
|
13
|
-
## Type Parameters
|
|
14
|
-
|
|
15
|
-
### Output
|
|
16
|
-
|
|
17
|
-
`Output` = `string`
|
|
18
|
-
|
|
19
|
-
Output type (default: string)
|
|
20
|
-
|
|
21
|
-
## Methods
|
|
22
|
-
|
|
23
|
-
### write()
|
|
24
|
-
|
|
25
|
-
> **write**(`tree`, `assets?`): `Promise`\<[`ConvertResult`](ConvertResult.md)\<`Output`\>\>
|
|
26
|
-
|
|
27
|
-
Defined in: [packages/mdast-plus/src/types.ts:160](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L160)
|
|
28
|
-
|
|
29
|
-
Writes the mdast tree to the target output.
|
|
30
|
-
|
|
31
|
-
#### Parameters
|
|
32
|
-
|
|
33
|
-
##### tree
|
|
34
|
-
|
|
35
|
-
`Root`
|
|
36
|
-
|
|
37
|
-
The Root node to write
|
|
38
|
-
|
|
39
|
-
##### assets?
|
|
40
|
-
|
|
41
|
-
[`MdastAsset`](MdastAsset.md)[]
|
|
42
|
-
|
|
43
|
-
Optional assets to include
|
|
44
|
-
|
|
45
|
-
#### Returns
|
|
46
|
-
|
|
47
|
-
`Promise`\<[`ConvertResult`](ConvertResult.md)\<`Output`\>\>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[**@isdk/mdast-plus**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
[@isdk/mdast-plus](../globals.md) / Stage
|
|
6
|
-
|
|
7
|
-
# Type Alias: Stage
|
|
8
|
-
|
|
9
|
-
> **Stage** = `"normalize"` \| `"compile"` \| `"finalize"`
|
|
10
|
-
|
|
11
|
-
Defined in: [packages/mdast-plus/src/types.ts:8](https://github.com/isdk/mdast-plus.js/blob/75ee549d3fb31ef4bc1b4a6b3307f6368072874e/src/types.ts#L8)
|
|
12
|
-
|
|
13
|
-
Stages for mdast-plus pipeline processing.
|