flatmarkdown-ast2html 0.1.0 → 0.1.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/dist/index.d.cts +4 -212
- package/dist/index.d.ts +4 -212
- package/package.json +4 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,214 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
interface ParagraphNode {
|
|
6
|
-
type: 'paragraph';
|
|
7
|
-
children?: AstNode[];
|
|
8
|
-
}
|
|
9
|
-
interface HeadingNode {
|
|
10
|
-
type: 'heading';
|
|
11
|
-
level: number;
|
|
12
|
-
setext: boolean;
|
|
13
|
-
children?: AstNode[];
|
|
14
|
-
}
|
|
15
|
-
interface CodeBlockNode {
|
|
16
|
-
type: 'code_block';
|
|
17
|
-
fenced: boolean;
|
|
18
|
-
info: string;
|
|
19
|
-
literal: string;
|
|
20
|
-
}
|
|
21
|
-
interface BlockQuoteNode {
|
|
22
|
-
type: 'block_quote';
|
|
23
|
-
children?: AstNode[];
|
|
24
|
-
}
|
|
25
|
-
interface MultilineBlockQuoteNode {
|
|
26
|
-
type: 'multiline_block_quote';
|
|
27
|
-
children?: AstNode[];
|
|
28
|
-
}
|
|
29
|
-
interface ListNode {
|
|
30
|
-
type: 'list';
|
|
31
|
-
list_type: string;
|
|
32
|
-
start: number | null;
|
|
33
|
-
tight: boolean;
|
|
34
|
-
delimiter: string;
|
|
35
|
-
children?: AstNode[];
|
|
36
|
-
}
|
|
37
|
-
interface ItemNode {
|
|
38
|
-
type: 'item';
|
|
39
|
-
list_type: string;
|
|
40
|
-
start: number;
|
|
41
|
-
tight: boolean;
|
|
42
|
-
children?: AstNode[];
|
|
43
|
-
}
|
|
44
|
-
interface TaskItemNode {
|
|
45
|
-
type: 'task_item';
|
|
46
|
-
symbol: string | null;
|
|
47
|
-
children?: AstNode[];
|
|
48
|
-
}
|
|
49
|
-
interface TableNode {
|
|
50
|
-
type: 'table';
|
|
51
|
-
alignments: string[];
|
|
52
|
-
num_columns: number;
|
|
53
|
-
num_rows: number;
|
|
54
|
-
children?: AstNode[];
|
|
55
|
-
}
|
|
56
|
-
interface TableRowNode {
|
|
57
|
-
type: 'table_row';
|
|
58
|
-
header: boolean;
|
|
59
|
-
children?: AstNode[];
|
|
60
|
-
}
|
|
61
|
-
interface TableCellNode {
|
|
62
|
-
type: 'table_cell';
|
|
63
|
-
children?: AstNode[];
|
|
64
|
-
}
|
|
65
|
-
interface ThematicBreakNode {
|
|
66
|
-
type: 'thematic_break';
|
|
67
|
-
}
|
|
68
|
-
interface HtmlBlockNode {
|
|
69
|
-
type: 'html_block';
|
|
70
|
-
block_type: number;
|
|
71
|
-
literal: string;
|
|
72
|
-
}
|
|
73
|
-
interface FootnoteDefinitionNode {
|
|
74
|
-
type: 'footnote_definition';
|
|
75
|
-
name: string;
|
|
76
|
-
children?: AstNode[];
|
|
77
|
-
}
|
|
78
|
-
interface DescriptionListNode {
|
|
79
|
-
type: 'description_list';
|
|
80
|
-
children?: AstNode[];
|
|
81
|
-
}
|
|
82
|
-
interface DescriptionItemNode {
|
|
83
|
-
type: 'description_item';
|
|
84
|
-
children?: AstNode[];
|
|
85
|
-
}
|
|
86
|
-
interface DescriptionTermNode {
|
|
87
|
-
type: 'description_term';
|
|
88
|
-
children?: AstNode[];
|
|
89
|
-
}
|
|
90
|
-
interface DescriptionDetailsNode {
|
|
91
|
-
type: 'description_details';
|
|
92
|
-
children?: AstNode[];
|
|
93
|
-
}
|
|
94
|
-
interface AlertNode {
|
|
95
|
-
type: 'alert';
|
|
96
|
-
alert_type: string;
|
|
97
|
-
title: string | null;
|
|
98
|
-
children?: AstNode[];
|
|
99
|
-
}
|
|
100
|
-
interface FrontMatterNode {
|
|
101
|
-
type: 'front_matter';
|
|
102
|
-
value: string;
|
|
103
|
-
}
|
|
104
|
-
interface HeexBlockNode {
|
|
105
|
-
type: 'heex_block';
|
|
106
|
-
children?: AstNode[];
|
|
107
|
-
}
|
|
108
|
-
interface SubtextNode {
|
|
109
|
-
type: 'subtext';
|
|
110
|
-
children?: AstNode[];
|
|
111
|
-
}
|
|
112
|
-
interface TextNode {
|
|
113
|
-
type: 'text';
|
|
114
|
-
value: string;
|
|
115
|
-
}
|
|
116
|
-
interface SoftbreakNode {
|
|
117
|
-
type: 'softbreak';
|
|
118
|
-
}
|
|
119
|
-
interface LinebreakNode {
|
|
120
|
-
type: 'linebreak';
|
|
121
|
-
}
|
|
122
|
-
interface EmphNode {
|
|
123
|
-
type: 'emph';
|
|
124
|
-
children?: AstNode[];
|
|
125
|
-
}
|
|
126
|
-
interface StrongNode {
|
|
127
|
-
type: 'strong';
|
|
128
|
-
children?: AstNode[];
|
|
129
|
-
}
|
|
130
|
-
interface StrikethroughNode {
|
|
131
|
-
type: 'strikethrough';
|
|
132
|
-
children?: AstNode[];
|
|
133
|
-
}
|
|
134
|
-
interface UnderlineNode {
|
|
135
|
-
type: 'underline';
|
|
136
|
-
children?: AstNode[];
|
|
137
|
-
}
|
|
138
|
-
interface HighlightNode {
|
|
139
|
-
type: 'highlight';
|
|
140
|
-
children?: AstNode[];
|
|
141
|
-
}
|
|
142
|
-
interface SuperscriptNode {
|
|
143
|
-
type: 'superscript';
|
|
144
|
-
children?: AstNode[];
|
|
145
|
-
}
|
|
146
|
-
interface SubscriptNode {
|
|
147
|
-
type: 'subscript';
|
|
148
|
-
children?: AstNode[];
|
|
149
|
-
}
|
|
150
|
-
interface SpoileredTextNode {
|
|
151
|
-
type: 'spoilered_text';
|
|
152
|
-
children?: AstNode[];
|
|
153
|
-
}
|
|
154
|
-
interface CodeNode {
|
|
155
|
-
type: 'code';
|
|
156
|
-
literal: string;
|
|
157
|
-
}
|
|
158
|
-
interface LinkNode {
|
|
159
|
-
type: 'link';
|
|
160
|
-
url: string;
|
|
161
|
-
title: string;
|
|
162
|
-
children?: AstNode[];
|
|
163
|
-
}
|
|
164
|
-
interface ImageNode {
|
|
165
|
-
type: 'image';
|
|
166
|
-
url: string;
|
|
167
|
-
title: string;
|
|
168
|
-
children?: AstNode[];
|
|
169
|
-
}
|
|
170
|
-
interface FootnoteReferenceNode {
|
|
171
|
-
type: 'footnote_reference';
|
|
172
|
-
name: string;
|
|
173
|
-
ref_num: number;
|
|
174
|
-
ix: number;
|
|
175
|
-
}
|
|
176
|
-
interface ShortcodeNode {
|
|
177
|
-
type: 'shortcode';
|
|
178
|
-
code: string;
|
|
179
|
-
emoji: string;
|
|
180
|
-
}
|
|
181
|
-
interface MathNode {
|
|
182
|
-
type: 'math';
|
|
183
|
-
dollar_math: boolean;
|
|
184
|
-
display_math: boolean;
|
|
185
|
-
literal: string;
|
|
186
|
-
}
|
|
187
|
-
interface HtmlInlineNode {
|
|
188
|
-
type: 'html_inline';
|
|
189
|
-
value: string;
|
|
190
|
-
}
|
|
191
|
-
interface HeexInlineNode {
|
|
192
|
-
type: 'heex_inline';
|
|
193
|
-
value: string;
|
|
194
|
-
}
|
|
195
|
-
interface RawNode {
|
|
196
|
-
type: 'raw';
|
|
197
|
-
value: string;
|
|
198
|
-
}
|
|
199
|
-
interface EscapedNode {
|
|
200
|
-
type: 'escaped';
|
|
201
|
-
}
|
|
202
|
-
interface EscapedTagNode {
|
|
203
|
-
type: 'escaped_tag';
|
|
204
|
-
value: string;
|
|
205
|
-
}
|
|
206
|
-
interface WikilinkNode {
|
|
207
|
-
type: 'wikilink';
|
|
208
|
-
url: string;
|
|
209
|
-
children?: AstNode[];
|
|
210
|
-
}
|
|
211
|
-
type AstNode = DocumentNode | ParagraphNode | HeadingNode | CodeBlockNode | BlockQuoteNode | MultilineBlockQuoteNode | ListNode | ItemNode | TaskItemNode | TableNode | TableRowNode | TableCellNode | ThematicBreakNode | HtmlBlockNode | FootnoteDefinitionNode | DescriptionListNode | DescriptionItemNode | DescriptionTermNode | DescriptionDetailsNode | AlertNode | FrontMatterNode | HeexBlockNode | SubtextNode | TextNode | SoftbreakNode | LinebreakNode | EmphNode | StrongNode | StrikethroughNode | UnderlineNode | HighlightNode | SuperscriptNode | SubscriptNode | SpoileredTextNode | CodeNode | LinkNode | ImageNode | FootnoteReferenceNode | ShortcodeNode | MathNode | HtmlInlineNode | HeexInlineNode | RawNode | EscapedNode | EscapedTagNode | WikilinkNode;
|
|
1
|
+
import { AstNode } from 'flatmarkdown-ast';
|
|
2
|
+
export { AlertNode, AstNode, BlockQuoteNode, CodeBlockNode, CodeNode, DescriptionDetailsNode, DescriptionItemNode, DescriptionListNode, DescriptionTermNode, DocumentNode, EmphNode, EscapedNode, EscapedTagNode, FootnoteDefinitionNode, FootnoteReferenceNode, FrontMatterNode, HeadingNode, HeexBlockNode, HeexInlineNode, HighlightNode, HtmlBlockNode, HtmlInlineNode, ImageNode, ItemNode, LinebreakNode, LinkNode, ListNode, MathNode, MultilineBlockQuoteNode, ParagraphNode, RawNode, ShortcodeNode, SoftbreakNode, SpoileredTextNode, StrikethroughNode, StrongNode, SubscriptNode, SubtextNode, SuperscriptNode, TableCellNode, TableNode, TableRowNode, TaskItemNode, TextNode, ThematicBreakNode, UnderlineNode, WikilinkNode } from 'flatmarkdown-ast';
|
|
3
|
+
|
|
212
4
|
interface WikiLinkOptions {
|
|
213
5
|
/** Tag name. Default: 'a'. Use 'Link' for React Router, etc. */
|
|
214
6
|
tagName?: string;
|
|
@@ -232,4 +24,4 @@ interface RenderOptions {
|
|
|
232
24
|
*/
|
|
233
25
|
declare function renderToHtml(ast: AstNode | string, options?: RenderOptions): string;
|
|
234
26
|
|
|
235
|
-
export { type
|
|
27
|
+
export { type RenderOptions, type WikiLinkOptions, renderToHtml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,214 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
interface ParagraphNode {
|
|
6
|
-
type: 'paragraph';
|
|
7
|
-
children?: AstNode[];
|
|
8
|
-
}
|
|
9
|
-
interface HeadingNode {
|
|
10
|
-
type: 'heading';
|
|
11
|
-
level: number;
|
|
12
|
-
setext: boolean;
|
|
13
|
-
children?: AstNode[];
|
|
14
|
-
}
|
|
15
|
-
interface CodeBlockNode {
|
|
16
|
-
type: 'code_block';
|
|
17
|
-
fenced: boolean;
|
|
18
|
-
info: string;
|
|
19
|
-
literal: string;
|
|
20
|
-
}
|
|
21
|
-
interface BlockQuoteNode {
|
|
22
|
-
type: 'block_quote';
|
|
23
|
-
children?: AstNode[];
|
|
24
|
-
}
|
|
25
|
-
interface MultilineBlockQuoteNode {
|
|
26
|
-
type: 'multiline_block_quote';
|
|
27
|
-
children?: AstNode[];
|
|
28
|
-
}
|
|
29
|
-
interface ListNode {
|
|
30
|
-
type: 'list';
|
|
31
|
-
list_type: string;
|
|
32
|
-
start: number | null;
|
|
33
|
-
tight: boolean;
|
|
34
|
-
delimiter: string;
|
|
35
|
-
children?: AstNode[];
|
|
36
|
-
}
|
|
37
|
-
interface ItemNode {
|
|
38
|
-
type: 'item';
|
|
39
|
-
list_type: string;
|
|
40
|
-
start: number;
|
|
41
|
-
tight: boolean;
|
|
42
|
-
children?: AstNode[];
|
|
43
|
-
}
|
|
44
|
-
interface TaskItemNode {
|
|
45
|
-
type: 'task_item';
|
|
46
|
-
symbol: string | null;
|
|
47
|
-
children?: AstNode[];
|
|
48
|
-
}
|
|
49
|
-
interface TableNode {
|
|
50
|
-
type: 'table';
|
|
51
|
-
alignments: string[];
|
|
52
|
-
num_columns: number;
|
|
53
|
-
num_rows: number;
|
|
54
|
-
children?: AstNode[];
|
|
55
|
-
}
|
|
56
|
-
interface TableRowNode {
|
|
57
|
-
type: 'table_row';
|
|
58
|
-
header: boolean;
|
|
59
|
-
children?: AstNode[];
|
|
60
|
-
}
|
|
61
|
-
interface TableCellNode {
|
|
62
|
-
type: 'table_cell';
|
|
63
|
-
children?: AstNode[];
|
|
64
|
-
}
|
|
65
|
-
interface ThematicBreakNode {
|
|
66
|
-
type: 'thematic_break';
|
|
67
|
-
}
|
|
68
|
-
interface HtmlBlockNode {
|
|
69
|
-
type: 'html_block';
|
|
70
|
-
block_type: number;
|
|
71
|
-
literal: string;
|
|
72
|
-
}
|
|
73
|
-
interface FootnoteDefinitionNode {
|
|
74
|
-
type: 'footnote_definition';
|
|
75
|
-
name: string;
|
|
76
|
-
children?: AstNode[];
|
|
77
|
-
}
|
|
78
|
-
interface DescriptionListNode {
|
|
79
|
-
type: 'description_list';
|
|
80
|
-
children?: AstNode[];
|
|
81
|
-
}
|
|
82
|
-
interface DescriptionItemNode {
|
|
83
|
-
type: 'description_item';
|
|
84
|
-
children?: AstNode[];
|
|
85
|
-
}
|
|
86
|
-
interface DescriptionTermNode {
|
|
87
|
-
type: 'description_term';
|
|
88
|
-
children?: AstNode[];
|
|
89
|
-
}
|
|
90
|
-
interface DescriptionDetailsNode {
|
|
91
|
-
type: 'description_details';
|
|
92
|
-
children?: AstNode[];
|
|
93
|
-
}
|
|
94
|
-
interface AlertNode {
|
|
95
|
-
type: 'alert';
|
|
96
|
-
alert_type: string;
|
|
97
|
-
title: string | null;
|
|
98
|
-
children?: AstNode[];
|
|
99
|
-
}
|
|
100
|
-
interface FrontMatterNode {
|
|
101
|
-
type: 'front_matter';
|
|
102
|
-
value: string;
|
|
103
|
-
}
|
|
104
|
-
interface HeexBlockNode {
|
|
105
|
-
type: 'heex_block';
|
|
106
|
-
children?: AstNode[];
|
|
107
|
-
}
|
|
108
|
-
interface SubtextNode {
|
|
109
|
-
type: 'subtext';
|
|
110
|
-
children?: AstNode[];
|
|
111
|
-
}
|
|
112
|
-
interface TextNode {
|
|
113
|
-
type: 'text';
|
|
114
|
-
value: string;
|
|
115
|
-
}
|
|
116
|
-
interface SoftbreakNode {
|
|
117
|
-
type: 'softbreak';
|
|
118
|
-
}
|
|
119
|
-
interface LinebreakNode {
|
|
120
|
-
type: 'linebreak';
|
|
121
|
-
}
|
|
122
|
-
interface EmphNode {
|
|
123
|
-
type: 'emph';
|
|
124
|
-
children?: AstNode[];
|
|
125
|
-
}
|
|
126
|
-
interface StrongNode {
|
|
127
|
-
type: 'strong';
|
|
128
|
-
children?: AstNode[];
|
|
129
|
-
}
|
|
130
|
-
interface StrikethroughNode {
|
|
131
|
-
type: 'strikethrough';
|
|
132
|
-
children?: AstNode[];
|
|
133
|
-
}
|
|
134
|
-
interface UnderlineNode {
|
|
135
|
-
type: 'underline';
|
|
136
|
-
children?: AstNode[];
|
|
137
|
-
}
|
|
138
|
-
interface HighlightNode {
|
|
139
|
-
type: 'highlight';
|
|
140
|
-
children?: AstNode[];
|
|
141
|
-
}
|
|
142
|
-
interface SuperscriptNode {
|
|
143
|
-
type: 'superscript';
|
|
144
|
-
children?: AstNode[];
|
|
145
|
-
}
|
|
146
|
-
interface SubscriptNode {
|
|
147
|
-
type: 'subscript';
|
|
148
|
-
children?: AstNode[];
|
|
149
|
-
}
|
|
150
|
-
interface SpoileredTextNode {
|
|
151
|
-
type: 'spoilered_text';
|
|
152
|
-
children?: AstNode[];
|
|
153
|
-
}
|
|
154
|
-
interface CodeNode {
|
|
155
|
-
type: 'code';
|
|
156
|
-
literal: string;
|
|
157
|
-
}
|
|
158
|
-
interface LinkNode {
|
|
159
|
-
type: 'link';
|
|
160
|
-
url: string;
|
|
161
|
-
title: string;
|
|
162
|
-
children?: AstNode[];
|
|
163
|
-
}
|
|
164
|
-
interface ImageNode {
|
|
165
|
-
type: 'image';
|
|
166
|
-
url: string;
|
|
167
|
-
title: string;
|
|
168
|
-
children?: AstNode[];
|
|
169
|
-
}
|
|
170
|
-
interface FootnoteReferenceNode {
|
|
171
|
-
type: 'footnote_reference';
|
|
172
|
-
name: string;
|
|
173
|
-
ref_num: number;
|
|
174
|
-
ix: number;
|
|
175
|
-
}
|
|
176
|
-
interface ShortcodeNode {
|
|
177
|
-
type: 'shortcode';
|
|
178
|
-
code: string;
|
|
179
|
-
emoji: string;
|
|
180
|
-
}
|
|
181
|
-
interface MathNode {
|
|
182
|
-
type: 'math';
|
|
183
|
-
dollar_math: boolean;
|
|
184
|
-
display_math: boolean;
|
|
185
|
-
literal: string;
|
|
186
|
-
}
|
|
187
|
-
interface HtmlInlineNode {
|
|
188
|
-
type: 'html_inline';
|
|
189
|
-
value: string;
|
|
190
|
-
}
|
|
191
|
-
interface HeexInlineNode {
|
|
192
|
-
type: 'heex_inline';
|
|
193
|
-
value: string;
|
|
194
|
-
}
|
|
195
|
-
interface RawNode {
|
|
196
|
-
type: 'raw';
|
|
197
|
-
value: string;
|
|
198
|
-
}
|
|
199
|
-
interface EscapedNode {
|
|
200
|
-
type: 'escaped';
|
|
201
|
-
}
|
|
202
|
-
interface EscapedTagNode {
|
|
203
|
-
type: 'escaped_tag';
|
|
204
|
-
value: string;
|
|
205
|
-
}
|
|
206
|
-
interface WikilinkNode {
|
|
207
|
-
type: 'wikilink';
|
|
208
|
-
url: string;
|
|
209
|
-
children?: AstNode[];
|
|
210
|
-
}
|
|
211
|
-
type AstNode = DocumentNode | ParagraphNode | HeadingNode | CodeBlockNode | BlockQuoteNode | MultilineBlockQuoteNode | ListNode | ItemNode | TaskItemNode | TableNode | TableRowNode | TableCellNode | ThematicBreakNode | HtmlBlockNode | FootnoteDefinitionNode | DescriptionListNode | DescriptionItemNode | DescriptionTermNode | DescriptionDetailsNode | AlertNode | FrontMatterNode | HeexBlockNode | SubtextNode | TextNode | SoftbreakNode | LinebreakNode | EmphNode | StrongNode | StrikethroughNode | UnderlineNode | HighlightNode | SuperscriptNode | SubscriptNode | SpoileredTextNode | CodeNode | LinkNode | ImageNode | FootnoteReferenceNode | ShortcodeNode | MathNode | HtmlInlineNode | HeexInlineNode | RawNode | EscapedNode | EscapedTagNode | WikilinkNode;
|
|
1
|
+
import { AstNode } from 'flatmarkdown-ast';
|
|
2
|
+
export { AlertNode, AstNode, BlockQuoteNode, CodeBlockNode, CodeNode, DescriptionDetailsNode, DescriptionItemNode, DescriptionListNode, DescriptionTermNode, DocumentNode, EmphNode, EscapedNode, EscapedTagNode, FootnoteDefinitionNode, FootnoteReferenceNode, FrontMatterNode, HeadingNode, HeexBlockNode, HeexInlineNode, HighlightNode, HtmlBlockNode, HtmlInlineNode, ImageNode, ItemNode, LinebreakNode, LinkNode, ListNode, MathNode, MultilineBlockQuoteNode, ParagraphNode, RawNode, ShortcodeNode, SoftbreakNode, SpoileredTextNode, StrikethroughNode, StrongNode, SubscriptNode, SubtextNode, SuperscriptNode, TableCellNode, TableNode, TableRowNode, TaskItemNode, TextNode, ThematicBreakNode, UnderlineNode, WikilinkNode } from 'flatmarkdown-ast';
|
|
3
|
+
|
|
212
4
|
interface WikiLinkOptions {
|
|
213
5
|
/** Tag name. Default: 'a'. Use 'Link' for React Router, etc. */
|
|
214
6
|
tagName?: string;
|
|
@@ -232,4 +24,4 @@ interface RenderOptions {
|
|
|
232
24
|
*/
|
|
233
25
|
declare function renderToHtml(ast: AstNode | string, options?: RenderOptions): string;
|
|
234
26
|
|
|
235
|
-
export { type
|
|
27
|
+
export { type RenderOptions, type WikiLinkOptions, renderToHtml };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flatmarkdown-ast2html",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A library to convert FlatMarkdown AST to HTML.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -38,6 +38,9 @@
|
|
|
38
38
|
],
|
|
39
39
|
"author": "Hidekazu Kubota",
|
|
40
40
|
"license": "MIT",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"flatmarkdown-ast": "^0.1.0"
|
|
43
|
+
},
|
|
41
44
|
"devDependencies": {
|
|
42
45
|
"tsup": "^8.0.0",
|
|
43
46
|
"vitest": "^3.0.0",
|