vantage-md 0.6.0 → 0.6.2
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.cjs +3 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1047 -82
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1047 -82
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +3 -6
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1036 -71
- package/dist/react.d.cts.map +1 -1
- package/dist/react.d.ts +1036 -71
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +3 -6
- package/dist/react.js.map +1 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,50 +1,5 @@
|
|
|
1
1
|
import { PluggableList, Plugin } from "unified";
|
|
2
2
|
import { defaultSchema } from "rehype-sanitize";
|
|
3
|
-
//#region src/renderMarkdown.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Framework-agnostic markdown -> HTML rendering pipeline.
|
|
6
|
-
* Uses the same remark/rehype chain as the Vantage viewer.
|
|
7
|
-
*/
|
|
8
|
-
interface RenderOptions {
|
|
9
|
-
/** Enable GFM tables, strikethrough, task lists (default: true) */
|
|
10
|
-
gfm?: boolean;
|
|
11
|
-
/** Enable KaTeX math rendering (default: true) */
|
|
12
|
-
math?: boolean;
|
|
13
|
-
/** Enable syntax highlighting (default: true) */
|
|
14
|
-
highlight?: boolean;
|
|
15
|
-
/** Add data-source-line attributes for line anchors (default: true) */
|
|
16
|
-
sourceLines?: boolean;
|
|
17
|
-
/** Enable XSS sanitization (default: true) */
|
|
18
|
-
sanitize?: boolean;
|
|
19
|
-
/** Parse and strip frontmatter (default: true) */
|
|
20
|
-
frontmatter?: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface RenderResult {
|
|
23
|
-
/** The rendered HTML string */
|
|
24
|
-
html: string;
|
|
25
|
-
/** Parsed frontmatter (empty object if none or disabled) */
|
|
26
|
-
frontmatter: Record<string, unknown>;
|
|
27
|
-
/** The markdown body with frontmatter stripped */
|
|
28
|
-
body: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Render a markdown string to HTML using the full Vantage pipeline.
|
|
32
|
-
*
|
|
33
|
-
* Features (all enabled by default):
|
|
34
|
-
* - GitHub Flavored Markdown (tables, strikethrough, task lists)
|
|
35
|
-
* - KaTeX math rendering, inline and block ($$...$$ only; single $ is not a delimiter)
|
|
36
|
-
* - Syntax highlighting via highlight.js
|
|
37
|
-
* - `data-source-line` attributes for line anchors
|
|
38
|
-
* - XSS sanitization
|
|
39
|
-
* - Heading slugs/anchors
|
|
40
|
-
* - YAML/TOML frontmatter parsing
|
|
41
|
-
*
|
|
42
|
-
* Mermaid diagrams are NOT rendered server-side (they require a browser).
|
|
43
|
-
* Mermaid code blocks are preserved as `<pre><code class="language-mermaid">`.
|
|
44
|
-
* Use the React `<MarkdownViewer>` component for client-side mermaid rendering.
|
|
45
|
-
*/
|
|
46
|
-
declare function renderMarkdown(content: string, options?: RenderOptions): Promise<RenderResult>;
|
|
47
|
-
//#endregion
|
|
48
3
|
//#region ../../node_modules/@types/unist/index.d.ts
|
|
49
4
|
// ## Interfaces
|
|
50
5
|
/**
|
|
@@ -66,7 +21,7 @@ declare function renderMarkdown(content: string, options?: RenderOptions): Promi
|
|
|
66
21
|
* }
|
|
67
22
|
* ```
|
|
68
23
|
*/
|
|
69
|
-
interface Data$
|
|
24
|
+
interface Data$2 {}
|
|
70
25
|
/**
|
|
71
26
|
* One place in a source file.
|
|
72
27
|
*/
|
|
@@ -109,7 +64,7 @@ interface Position {
|
|
|
109
64
|
* But for example in markdown, a `thematicBreak` (`***`), is neither literal
|
|
110
65
|
* nor parent, but still a node.
|
|
111
66
|
*/
|
|
112
|
-
interface Node$
|
|
67
|
+
interface Node$2 {
|
|
113
68
|
/**
|
|
114
69
|
* Node type.
|
|
115
70
|
*/
|
|
@@ -117,7 +72,7 @@ interface Node$1 {
|
|
|
117
72
|
/**
|
|
118
73
|
* Info from the ecosystem.
|
|
119
74
|
*/
|
|
120
|
-
data?: Data$
|
|
75
|
+
data?: Data$2 | undefined;
|
|
121
76
|
/**
|
|
122
77
|
* Position of a node in a source document.
|
|
123
78
|
*
|
|
@@ -127,6 +82,1016 @@ interface Node$1 {
|
|
|
127
82
|
position?: Position | undefined;
|
|
128
83
|
}
|
|
129
84
|
//#endregion
|
|
85
|
+
//#region ../../node_modules/@types/mdast/index.d.ts
|
|
86
|
+
// ## Enumeration
|
|
87
|
+
/**
|
|
88
|
+
* How phrasing content is aligned
|
|
89
|
+
* ({@link https://drafts.csswg.org/css-text/ | [CSSTEXT]}).
|
|
90
|
+
*
|
|
91
|
+
* * `'left'`: See the
|
|
92
|
+
* {@link https://drafts.csswg.org/css-text/#valdef-text-align-left | left}
|
|
93
|
+
* value of the `text-align` CSS property
|
|
94
|
+
* * `'right'`: See the
|
|
95
|
+
* {@link https://drafts.csswg.org/css-text/#valdef-text-align-right | right}
|
|
96
|
+
* value of the `text-align` CSS property
|
|
97
|
+
* * `'center'`: See the
|
|
98
|
+
* {@link https://drafts.csswg.org/css-text/#valdef-text-align-center | center}
|
|
99
|
+
* value of the `text-align` CSS property
|
|
100
|
+
* * `null`: phrasing content is aligned as defined by the host environment
|
|
101
|
+
*
|
|
102
|
+
* Used in GFM tables.
|
|
103
|
+
*/
|
|
104
|
+
type AlignType = "center" | "left" | "right" | null;
|
|
105
|
+
/**
|
|
106
|
+
* Explicitness of a reference.
|
|
107
|
+
*
|
|
108
|
+
* `'shortcut'`: the reference is implicit, its identifier inferred from its
|
|
109
|
+
* content
|
|
110
|
+
* `'collapsed'`: the reference is explicit, its identifier inferred from its
|
|
111
|
+
* content
|
|
112
|
+
* `'full'`: the reference is explicit, its identifier explicitly set
|
|
113
|
+
*/
|
|
114
|
+
type ReferenceType = "shortcut" | "collapsed" | "full";
|
|
115
|
+
// ## Mixin
|
|
116
|
+
/**
|
|
117
|
+
* Node with a fallback.
|
|
118
|
+
*/
|
|
119
|
+
interface Alternative {
|
|
120
|
+
/**
|
|
121
|
+
* Equivalent content for environments that cannot represent the node as
|
|
122
|
+
* intended.
|
|
123
|
+
*/
|
|
124
|
+
alt?: string | null | undefined;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Internal relation from one node to another.
|
|
128
|
+
*
|
|
129
|
+
* Whether the value of `identifier` is expected to be a unique identifier or
|
|
130
|
+
* not depends on the type of node including the Association.
|
|
131
|
+
* An example of this is that they should be unique on {@link Definition},
|
|
132
|
+
* whereas multiple {@link LinkReference}s can be non-unique to be associated
|
|
133
|
+
* with one definition.
|
|
134
|
+
*/
|
|
135
|
+
interface Association {
|
|
136
|
+
/**
|
|
137
|
+
* Relation of association.
|
|
138
|
+
*
|
|
139
|
+
* `identifier` is a source value: character escapes and character
|
|
140
|
+
* references are not parsed.
|
|
141
|
+
*
|
|
142
|
+
* It can match another node.
|
|
143
|
+
*
|
|
144
|
+
* Its value must be normalized.
|
|
145
|
+
* To normalize a value, collapse markdown whitespace (`[\t\n\r ]+`) to a space,
|
|
146
|
+
* trim the optional initial and/or final space, and perform Unicode-aware
|
|
147
|
+
* case-folding.
|
|
148
|
+
*/
|
|
149
|
+
identifier: string;
|
|
150
|
+
/**
|
|
151
|
+
* Relation of association, in parsed form.
|
|
152
|
+
*
|
|
153
|
+
* `label` is a `string` value: it works just like `title` on {@link Link}
|
|
154
|
+
* or a `lang` on {@link Code}: character escapes and character references
|
|
155
|
+
* are parsed.
|
|
156
|
+
*
|
|
157
|
+
* It can match another node.
|
|
158
|
+
*/
|
|
159
|
+
label?: string | null | undefined;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Marker that is associated to another node.
|
|
163
|
+
*/
|
|
164
|
+
interface Reference extends Association {
|
|
165
|
+
/**
|
|
166
|
+
* Explicitness of the reference.
|
|
167
|
+
*/
|
|
168
|
+
referenceType: ReferenceType;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Reference to resource.
|
|
172
|
+
*/
|
|
173
|
+
interface Resource {
|
|
174
|
+
/**
|
|
175
|
+
* URL to the referenced resource.
|
|
176
|
+
*/
|
|
177
|
+
url: string;
|
|
178
|
+
/**
|
|
179
|
+
* Advisory information for the resource, such as would be appropriate for
|
|
180
|
+
* a tooltip.
|
|
181
|
+
*/
|
|
182
|
+
title?: string | null | undefined;
|
|
183
|
+
}
|
|
184
|
+
// ## Interfaces
|
|
185
|
+
/**
|
|
186
|
+
* Info associated with mdast nodes by the ecosystem.
|
|
187
|
+
*
|
|
188
|
+
* This space is guaranteed to never be specified by unist or mdast.
|
|
189
|
+
* But you can use it in utilities and plugins to store data.
|
|
190
|
+
*
|
|
191
|
+
* This type can be augmented to register custom data.
|
|
192
|
+
* For example:
|
|
193
|
+
*
|
|
194
|
+
* ```ts
|
|
195
|
+
* declare module 'mdast' {
|
|
196
|
+
* interface Data {
|
|
197
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
198
|
+
* myId?: number | undefined
|
|
199
|
+
* }
|
|
200
|
+
* }
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
interface Data$1 extends Data$2 {}
|
|
204
|
+
// ## Content maps
|
|
205
|
+
/**
|
|
206
|
+
* Union of registered mdast nodes that can occur where block content is
|
|
207
|
+
* expected.
|
|
208
|
+
*
|
|
209
|
+
* To register custom mdast nodes, add them to {@link BlockContentMap}.
|
|
210
|
+
* They will be automatically added here.
|
|
211
|
+
*/
|
|
212
|
+
type BlockContent = BlockContentMap[keyof BlockContentMap];
|
|
213
|
+
/**
|
|
214
|
+
* Registry of all mdast nodes that can occur where {@link BlockContent} is
|
|
215
|
+
* expected.
|
|
216
|
+
*
|
|
217
|
+
* This interface can be augmented to register custom node types:
|
|
218
|
+
*
|
|
219
|
+
* ```ts
|
|
220
|
+
* declare module 'mdast' {
|
|
221
|
+
* interface BlockContentMap {
|
|
222
|
+
* // Allow using MDX ESM nodes defined by `remark-mdx`.
|
|
223
|
+
* mdxjsEsm: MdxjsEsm;
|
|
224
|
+
* }
|
|
225
|
+
* }
|
|
226
|
+
* ```
|
|
227
|
+
*
|
|
228
|
+
* For a union of all block content, see {@link RootContent}.
|
|
229
|
+
*/
|
|
230
|
+
interface BlockContentMap {
|
|
231
|
+
blockquote: Blockquote;
|
|
232
|
+
code: Code;
|
|
233
|
+
heading: Heading;
|
|
234
|
+
html: Html;
|
|
235
|
+
list: List;
|
|
236
|
+
paragraph: Paragraph;
|
|
237
|
+
table: Table;
|
|
238
|
+
thematicBreak: ThematicBreak;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Union of registered mdast nodes that can occur where definition content is
|
|
242
|
+
* expected.
|
|
243
|
+
*
|
|
244
|
+
* To register custom mdast nodes, add them to {@link DefinitionContentMap}.
|
|
245
|
+
* They will be automatically added here.
|
|
246
|
+
*/
|
|
247
|
+
type DefinitionContent = DefinitionContentMap[keyof DefinitionContentMap];
|
|
248
|
+
/**
|
|
249
|
+
* Registry of all mdast nodes that can occur where {@link DefinitionContent}
|
|
250
|
+
* is expected.
|
|
251
|
+
*
|
|
252
|
+
* This interface can be augmented to register custom node types:
|
|
253
|
+
*
|
|
254
|
+
* ```ts
|
|
255
|
+
* declare module 'mdast' {
|
|
256
|
+
* interface DefinitionContentMap {
|
|
257
|
+
* custom: Custom;
|
|
258
|
+
* }
|
|
259
|
+
* }
|
|
260
|
+
* ```
|
|
261
|
+
*
|
|
262
|
+
* For a union of all definition content, see {@link RootContent}.
|
|
263
|
+
*/
|
|
264
|
+
interface DefinitionContentMap {
|
|
265
|
+
definition: Definition;
|
|
266
|
+
footnoteDefinition: FootnoteDefinition;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Union of registered mdast nodes that can occur where list content is
|
|
270
|
+
* expected.
|
|
271
|
+
*
|
|
272
|
+
* To register custom mdast nodes, add them to {@link ListContentMap}.
|
|
273
|
+
* They will be automatically added here.
|
|
274
|
+
*/
|
|
275
|
+
type ListContent = ListContentMap[keyof ListContentMap];
|
|
276
|
+
/**
|
|
277
|
+
* Registry of all mdast nodes that can occur where {@link ListContent}
|
|
278
|
+
* is expected.
|
|
279
|
+
*
|
|
280
|
+
* This interface can be augmented to register custom node types:
|
|
281
|
+
*
|
|
282
|
+
* ```ts
|
|
283
|
+
* declare module 'mdast' {
|
|
284
|
+
* interface ListContentMap {
|
|
285
|
+
* custom: Custom;
|
|
286
|
+
* }
|
|
287
|
+
* }
|
|
288
|
+
* ```
|
|
289
|
+
*
|
|
290
|
+
* For a union of all list content, see {@link RootContent}.
|
|
291
|
+
*/
|
|
292
|
+
interface ListContentMap {
|
|
293
|
+
listItem: ListItem;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Union of registered mdast nodes that can occur where phrasing content is
|
|
297
|
+
* expected.
|
|
298
|
+
*
|
|
299
|
+
* To register custom mdast nodes, add them to {@link PhrasingContentMap}.
|
|
300
|
+
* They will be automatically added here.
|
|
301
|
+
*/
|
|
302
|
+
type PhrasingContent = PhrasingContentMap[keyof PhrasingContentMap];
|
|
303
|
+
/**
|
|
304
|
+
* Registry of all mdast nodes that can occur where {@link PhrasingContent}
|
|
305
|
+
* is expected.
|
|
306
|
+
*
|
|
307
|
+
* This interface can be augmented to register custom node types:
|
|
308
|
+
*
|
|
309
|
+
* ```ts
|
|
310
|
+
* declare module 'mdast' {
|
|
311
|
+
* interface PhrasingContentMap {
|
|
312
|
+
* // Allow using MDX JSX (text) nodes defined by `remark-mdx`.
|
|
313
|
+
* mdxJsxTextElement: MDXJSXTextElement;
|
|
314
|
+
* }
|
|
315
|
+
* }
|
|
316
|
+
* ```
|
|
317
|
+
*
|
|
318
|
+
* For a union of all phrasing content, see {@link RootContent}.
|
|
319
|
+
*/
|
|
320
|
+
interface PhrasingContentMap {
|
|
321
|
+
break: Break;
|
|
322
|
+
delete: Delete;
|
|
323
|
+
emphasis: Emphasis;
|
|
324
|
+
footnoteReference: FootnoteReference;
|
|
325
|
+
html: Html;
|
|
326
|
+
image: Image;
|
|
327
|
+
imageReference: ImageReference;
|
|
328
|
+
inlineCode: InlineCode;
|
|
329
|
+
link: Link;
|
|
330
|
+
linkReference: LinkReference;
|
|
331
|
+
strong: Strong;
|
|
332
|
+
text: Text$1;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Union of registered mdast nodes that can occur in {@link Root}.
|
|
336
|
+
*
|
|
337
|
+
* To register custom mdast nodes, add them to {@link RootContentMap}.
|
|
338
|
+
* They will be automatically added here.
|
|
339
|
+
*/
|
|
340
|
+
type RootContent$1 = RootContentMap$1[keyof RootContentMap$1];
|
|
341
|
+
/**
|
|
342
|
+
* Registry of all mdast nodes that can occur as children of {@link Root}.
|
|
343
|
+
*
|
|
344
|
+
* > **Note**: {@link Root} does not need to be an entire document.
|
|
345
|
+
* > it can also be a fragment.
|
|
346
|
+
*
|
|
347
|
+
* This interface can be augmented to register custom node types:
|
|
348
|
+
*
|
|
349
|
+
* ```ts
|
|
350
|
+
* declare module 'mdast' {
|
|
351
|
+
* interface RootContentMap {
|
|
352
|
+
* // Allow using toml nodes defined by `remark-frontmatter`.
|
|
353
|
+
* toml: TOML;
|
|
354
|
+
* }
|
|
355
|
+
* }
|
|
356
|
+
* ```
|
|
357
|
+
*
|
|
358
|
+
* For a union of all {@link Root} children, see {@link RootContent}.
|
|
359
|
+
*/
|
|
360
|
+
interface RootContentMap$1 {
|
|
361
|
+
blockquote: Blockquote;
|
|
362
|
+
break: Break;
|
|
363
|
+
code: Code;
|
|
364
|
+
definition: Definition;
|
|
365
|
+
delete: Delete;
|
|
366
|
+
emphasis: Emphasis;
|
|
367
|
+
footnoteDefinition: FootnoteDefinition;
|
|
368
|
+
footnoteReference: FootnoteReference;
|
|
369
|
+
heading: Heading;
|
|
370
|
+
html: Html;
|
|
371
|
+
image: Image;
|
|
372
|
+
imageReference: ImageReference;
|
|
373
|
+
inlineCode: InlineCode;
|
|
374
|
+
link: Link;
|
|
375
|
+
linkReference: LinkReference;
|
|
376
|
+
list: List;
|
|
377
|
+
listItem: ListItem;
|
|
378
|
+
paragraph: Paragraph;
|
|
379
|
+
strong: Strong;
|
|
380
|
+
table: Table;
|
|
381
|
+
tableCell: TableCell;
|
|
382
|
+
tableRow: TableRow;
|
|
383
|
+
text: Text$1;
|
|
384
|
+
thematicBreak: ThematicBreak;
|
|
385
|
+
yaml: Yaml;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Union of registered mdast nodes that can occur where row content is
|
|
389
|
+
* expected.
|
|
390
|
+
*
|
|
391
|
+
* To register custom mdast nodes, add them to {@link RowContentMap}.
|
|
392
|
+
* They will be automatically added here.
|
|
393
|
+
*/
|
|
394
|
+
type RowContent = RowContentMap[keyof RowContentMap];
|
|
395
|
+
/**
|
|
396
|
+
* Registry of all mdast nodes that can occur where {@link RowContent}
|
|
397
|
+
* is expected.
|
|
398
|
+
*
|
|
399
|
+
* This interface can be augmented to register custom node types:
|
|
400
|
+
*
|
|
401
|
+
* ```ts
|
|
402
|
+
* declare module 'mdast' {
|
|
403
|
+
* interface RowContentMap {
|
|
404
|
+
* custom: Custom;
|
|
405
|
+
* }
|
|
406
|
+
* }
|
|
407
|
+
* ```
|
|
408
|
+
*
|
|
409
|
+
* For a union of all row content, see {@link RootContent}.
|
|
410
|
+
*/
|
|
411
|
+
interface RowContentMap {
|
|
412
|
+
tableCell: TableCell;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Union of registered mdast nodes that can occur where table content is
|
|
416
|
+
* expected.
|
|
417
|
+
*
|
|
418
|
+
* To register custom mdast nodes, add them to {@link TableContentMap}.
|
|
419
|
+
* They will be automatically added here.
|
|
420
|
+
*/
|
|
421
|
+
type TableContent = TableContentMap[keyof TableContentMap];
|
|
422
|
+
/**
|
|
423
|
+
* Registry of all mdast nodes that can occur where {@link TableContent}
|
|
424
|
+
* is expected.
|
|
425
|
+
*
|
|
426
|
+
* This interface can be augmented to register custom node types:
|
|
427
|
+
*
|
|
428
|
+
* ```ts
|
|
429
|
+
* declare module 'mdast' {
|
|
430
|
+
* interface TableContentMap {
|
|
431
|
+
* custom: Custom;
|
|
432
|
+
* }
|
|
433
|
+
* }
|
|
434
|
+
* ```
|
|
435
|
+
*
|
|
436
|
+
* For a union of all table content, see {@link RootContent}.
|
|
437
|
+
*/
|
|
438
|
+
interface TableContentMap {
|
|
439
|
+
tableRow: TableRow;
|
|
440
|
+
}
|
|
441
|
+
// ## Abstract nodes
|
|
442
|
+
/**
|
|
443
|
+
* Abstract mdast node that contains the smallest possible value.
|
|
444
|
+
*
|
|
445
|
+
* This interface is supposed to be extended if you make custom mdast nodes.
|
|
446
|
+
*
|
|
447
|
+
* For a union of all registered mdast literals, see {@link Literals}.
|
|
448
|
+
*/
|
|
449
|
+
interface Literal$1 extends Node$1 {
|
|
450
|
+
/**
|
|
451
|
+
* Plain-text value.
|
|
452
|
+
*/
|
|
453
|
+
value: string;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Abstract mdast node.
|
|
457
|
+
*
|
|
458
|
+
* This interface is supposed to be extended.
|
|
459
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
460
|
+
* But for example in markdown, a thematic break (`***`) is neither literal nor
|
|
461
|
+
* parent, but still a node.
|
|
462
|
+
*
|
|
463
|
+
* To register custom mdast nodes, add them to {@link RootContentMap} and other
|
|
464
|
+
* places where relevant (such as {@link ElementContentMap}).
|
|
465
|
+
*
|
|
466
|
+
* For a union of all registered mdast nodes, see {@link Nodes}.
|
|
467
|
+
*/
|
|
468
|
+
interface Node$1 extends Node$2 {
|
|
469
|
+
/**
|
|
470
|
+
* Info from the ecosystem.
|
|
471
|
+
*/
|
|
472
|
+
data?: Data$1 | undefined;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Abstract mdast node that contains other mdast nodes (*children*).
|
|
476
|
+
*
|
|
477
|
+
* This interface is supposed to be extended if you make custom mdast nodes.
|
|
478
|
+
*
|
|
479
|
+
* For a union of all registered mdast parents, see {@link Parents}.
|
|
480
|
+
*/
|
|
481
|
+
interface Parent$1 extends Node$1 {
|
|
482
|
+
/**
|
|
483
|
+
* List of children.
|
|
484
|
+
*/
|
|
485
|
+
children: RootContent$1[];
|
|
486
|
+
}
|
|
487
|
+
// ## Concrete nodes
|
|
488
|
+
/**
|
|
489
|
+
* Markdown block quote.
|
|
490
|
+
*/
|
|
491
|
+
interface Blockquote extends Parent$1 {
|
|
492
|
+
/**
|
|
493
|
+
* Node type of mdast block quote.
|
|
494
|
+
*/
|
|
495
|
+
type: "blockquote";
|
|
496
|
+
/**
|
|
497
|
+
* Children of block quote.
|
|
498
|
+
*/
|
|
499
|
+
children: Array<BlockContent | DefinitionContent>;
|
|
500
|
+
/**
|
|
501
|
+
* Data associated with the mdast block quote.
|
|
502
|
+
*/
|
|
503
|
+
data?: BlockquoteData | undefined;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Info associated with mdast block quote nodes by the ecosystem.
|
|
507
|
+
*/
|
|
508
|
+
interface BlockquoteData extends Data$1 {}
|
|
509
|
+
/**
|
|
510
|
+
* Markdown break.
|
|
511
|
+
*/
|
|
512
|
+
interface Break extends Node$1 {
|
|
513
|
+
/**
|
|
514
|
+
* Node type of mdast break.
|
|
515
|
+
*/
|
|
516
|
+
type: "break";
|
|
517
|
+
/**
|
|
518
|
+
* Data associated with the mdast break.
|
|
519
|
+
*/
|
|
520
|
+
data?: BreakData | undefined;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Info associated with mdast break nodes by the ecosystem.
|
|
524
|
+
*/
|
|
525
|
+
interface BreakData extends Data$1 {}
|
|
526
|
+
/**
|
|
527
|
+
* Markdown code (flow) (block).
|
|
528
|
+
*/
|
|
529
|
+
interface Code extends Literal$1 {
|
|
530
|
+
/**
|
|
531
|
+
* Node type of mdast code (flow).
|
|
532
|
+
*/
|
|
533
|
+
type: "code";
|
|
534
|
+
/**
|
|
535
|
+
* Language of computer code being marked up.
|
|
536
|
+
*/
|
|
537
|
+
lang?: string | null | undefined;
|
|
538
|
+
/**
|
|
539
|
+
* Custom information relating to the node.
|
|
540
|
+
*
|
|
541
|
+
* If the lang field is present, a meta field can be present.
|
|
542
|
+
*/
|
|
543
|
+
meta?: string | null | undefined;
|
|
544
|
+
/**
|
|
545
|
+
* Data associated with the mdast code (flow).
|
|
546
|
+
*/
|
|
547
|
+
data?: CodeData | undefined;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Info associated with mdast code (flow) (block) nodes by the ecosystem.
|
|
551
|
+
*/
|
|
552
|
+
interface CodeData extends Data$1 {}
|
|
553
|
+
/**
|
|
554
|
+
* Markdown definition.
|
|
555
|
+
*/
|
|
556
|
+
interface Definition extends Node$1, Association, Resource {
|
|
557
|
+
/**
|
|
558
|
+
* Node type of mdast definition.
|
|
559
|
+
*/
|
|
560
|
+
type: "definition";
|
|
561
|
+
/**
|
|
562
|
+
* Data associated with the mdast definition.
|
|
563
|
+
*/
|
|
564
|
+
data?: DefinitionData | undefined;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Info associated with mdast definition nodes by the ecosystem.
|
|
568
|
+
*/
|
|
569
|
+
interface DefinitionData extends Data$1 {}
|
|
570
|
+
/**
|
|
571
|
+
* Markdown GFM delete (strikethrough).
|
|
572
|
+
*/
|
|
573
|
+
interface Delete extends Parent$1 {
|
|
574
|
+
/**
|
|
575
|
+
* Node type of mdast GFM delete.
|
|
576
|
+
*/
|
|
577
|
+
type: "delete";
|
|
578
|
+
/**
|
|
579
|
+
* Children of GFM delete.
|
|
580
|
+
*/
|
|
581
|
+
children: PhrasingContent[];
|
|
582
|
+
/**
|
|
583
|
+
* Data associated with the mdast GFM delete.
|
|
584
|
+
*/
|
|
585
|
+
data?: DeleteData | undefined;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Info associated with mdast GFM delete nodes by the ecosystem.
|
|
589
|
+
*/
|
|
590
|
+
interface DeleteData extends Data$1 {}
|
|
591
|
+
/**
|
|
592
|
+
* Markdown emphasis.
|
|
593
|
+
*/
|
|
594
|
+
interface Emphasis extends Parent$1 {
|
|
595
|
+
/**
|
|
596
|
+
* Node type of mdast emphasis.
|
|
597
|
+
*/
|
|
598
|
+
type: "emphasis";
|
|
599
|
+
/**
|
|
600
|
+
* Children of emphasis.
|
|
601
|
+
*/
|
|
602
|
+
children: PhrasingContent[];
|
|
603
|
+
/**
|
|
604
|
+
* Data associated with the mdast emphasis.
|
|
605
|
+
*/
|
|
606
|
+
data?: EmphasisData | undefined;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Info associated with mdast emphasis nodes by the ecosystem.
|
|
610
|
+
*/
|
|
611
|
+
interface EmphasisData extends Data$1 {}
|
|
612
|
+
/**
|
|
613
|
+
* Markdown GFM footnote definition.
|
|
614
|
+
*/
|
|
615
|
+
interface FootnoteDefinition extends Parent$1, Association {
|
|
616
|
+
/**
|
|
617
|
+
* Node type of mdast GFM footnote definition.
|
|
618
|
+
*/
|
|
619
|
+
type: "footnoteDefinition";
|
|
620
|
+
/**
|
|
621
|
+
* Children of GFM footnote definition.
|
|
622
|
+
*/
|
|
623
|
+
children: Array<BlockContent | DefinitionContent>;
|
|
624
|
+
/**
|
|
625
|
+
* Data associated with the mdast GFM footnote definition.
|
|
626
|
+
*/
|
|
627
|
+
data?: FootnoteDefinitionData | undefined;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Info associated with mdast GFM footnote definition nodes by the ecosystem.
|
|
631
|
+
*/
|
|
632
|
+
interface FootnoteDefinitionData extends Data$1 {}
|
|
633
|
+
/**
|
|
634
|
+
* Markdown GFM footnote reference.
|
|
635
|
+
*/
|
|
636
|
+
interface FootnoteReference extends Association, Node$1 {
|
|
637
|
+
/**
|
|
638
|
+
* Node type of mdast GFM footnote reference.
|
|
639
|
+
*/
|
|
640
|
+
type: "footnoteReference";
|
|
641
|
+
/**
|
|
642
|
+
* Data associated with the mdast GFM footnote reference.
|
|
643
|
+
*/
|
|
644
|
+
data?: FootnoteReferenceData | undefined;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Info associated with mdast GFM footnote reference nodes by the ecosystem.
|
|
648
|
+
*/
|
|
649
|
+
interface FootnoteReferenceData extends Data$1 {}
|
|
650
|
+
/**
|
|
651
|
+
* Markdown heading.
|
|
652
|
+
*/
|
|
653
|
+
interface Heading extends Parent$1 {
|
|
654
|
+
/**
|
|
655
|
+
* Node type of mdast heading.
|
|
656
|
+
*/
|
|
657
|
+
type: "heading";
|
|
658
|
+
/**
|
|
659
|
+
* Heading rank.
|
|
660
|
+
*
|
|
661
|
+
* A value of `1` is said to be the highest rank and `6` the lowest.
|
|
662
|
+
*/
|
|
663
|
+
depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
664
|
+
/**
|
|
665
|
+
* Children of heading.
|
|
666
|
+
*/
|
|
667
|
+
children: PhrasingContent[];
|
|
668
|
+
/**
|
|
669
|
+
* Data associated with the mdast heading.
|
|
670
|
+
*/
|
|
671
|
+
data?: HeadingData | undefined;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Info associated with mdast heading nodes by the ecosystem.
|
|
675
|
+
*/
|
|
676
|
+
interface HeadingData extends Data$1 {}
|
|
677
|
+
/**
|
|
678
|
+
* Markdown HTML.
|
|
679
|
+
*/
|
|
680
|
+
interface Html extends Literal$1 {
|
|
681
|
+
/**
|
|
682
|
+
* Node type of mdast HTML.
|
|
683
|
+
*/
|
|
684
|
+
type: "html";
|
|
685
|
+
/**
|
|
686
|
+
* Data associated with the mdast HTML.
|
|
687
|
+
*/
|
|
688
|
+
data?: HtmlData | undefined;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Info associated with mdast HTML nodes by the ecosystem.
|
|
692
|
+
*/
|
|
693
|
+
interface HtmlData extends Data$1 {}
|
|
694
|
+
/**
|
|
695
|
+
* Markdown image.
|
|
696
|
+
*/
|
|
697
|
+
interface Image extends Alternative, Node$1, Resource {
|
|
698
|
+
/**
|
|
699
|
+
* Node type of mdast image.
|
|
700
|
+
*/
|
|
701
|
+
type: "image";
|
|
702
|
+
/**
|
|
703
|
+
* Data associated with the mdast image.
|
|
704
|
+
*/
|
|
705
|
+
data?: ImageData | undefined;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Info associated with mdast image nodes by the ecosystem.
|
|
709
|
+
*/
|
|
710
|
+
interface ImageData extends Data$1 {}
|
|
711
|
+
/**
|
|
712
|
+
* Markdown image reference.
|
|
713
|
+
*/
|
|
714
|
+
interface ImageReference extends Alternative, Node$1, Reference {
|
|
715
|
+
/**
|
|
716
|
+
* Node type of mdast image reference.
|
|
717
|
+
*/
|
|
718
|
+
type: "imageReference";
|
|
719
|
+
/**
|
|
720
|
+
* Data associated with the mdast image reference.
|
|
721
|
+
*/
|
|
722
|
+
data?: ImageReferenceData | undefined;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Info associated with mdast image reference nodes by the ecosystem.
|
|
726
|
+
*/
|
|
727
|
+
interface ImageReferenceData extends Data$1 {}
|
|
728
|
+
/**
|
|
729
|
+
* Markdown code (text) (inline).
|
|
730
|
+
*/
|
|
731
|
+
interface InlineCode extends Literal$1 {
|
|
732
|
+
/**
|
|
733
|
+
* Node type of mdast code (text).
|
|
734
|
+
*/
|
|
735
|
+
type: "inlineCode";
|
|
736
|
+
/**
|
|
737
|
+
* Data associated with the mdast code (text).
|
|
738
|
+
*/
|
|
739
|
+
data?: InlineCodeData | undefined;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Info associated with mdast code (text) (inline) nodes by the ecosystem.
|
|
743
|
+
*/
|
|
744
|
+
interface InlineCodeData extends Data$1 {}
|
|
745
|
+
/**
|
|
746
|
+
* Markdown link.
|
|
747
|
+
*/
|
|
748
|
+
interface Link extends Parent$1, Resource {
|
|
749
|
+
/**
|
|
750
|
+
* Node type of mdast link.
|
|
751
|
+
*/
|
|
752
|
+
type: "link";
|
|
753
|
+
/**
|
|
754
|
+
* Children of link.
|
|
755
|
+
*/
|
|
756
|
+
children: PhrasingContent[];
|
|
757
|
+
/**
|
|
758
|
+
* Data associated with the mdast link.
|
|
759
|
+
*/
|
|
760
|
+
data?: LinkData | undefined;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Info associated with mdast link nodes by the ecosystem.
|
|
764
|
+
*/
|
|
765
|
+
interface LinkData extends Data$1 {}
|
|
766
|
+
/**
|
|
767
|
+
* Markdown link reference.
|
|
768
|
+
*/
|
|
769
|
+
interface LinkReference extends Parent$1, Reference {
|
|
770
|
+
/**
|
|
771
|
+
* Node type of mdast link reference.
|
|
772
|
+
*/
|
|
773
|
+
type: "linkReference";
|
|
774
|
+
/**
|
|
775
|
+
* Children of link reference.
|
|
776
|
+
*/
|
|
777
|
+
children: PhrasingContent[];
|
|
778
|
+
/**
|
|
779
|
+
* Data associated with the mdast link reference.
|
|
780
|
+
*/
|
|
781
|
+
data?: LinkReferenceData | undefined;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Info associated with mdast link reference nodes by the ecosystem.
|
|
785
|
+
*/
|
|
786
|
+
interface LinkReferenceData extends Data$1 {}
|
|
787
|
+
/**
|
|
788
|
+
* Markdown list.
|
|
789
|
+
*/
|
|
790
|
+
interface List extends Parent$1 {
|
|
791
|
+
/**
|
|
792
|
+
* Node type of mdast list.
|
|
793
|
+
*/
|
|
794
|
+
type: "list";
|
|
795
|
+
/**
|
|
796
|
+
* Whether the items have been intentionally ordered (when `true`), or that
|
|
797
|
+
* the order of items is not important (when `false` or not present).
|
|
798
|
+
*/
|
|
799
|
+
ordered?: boolean | null | undefined;
|
|
800
|
+
/**
|
|
801
|
+
* The starting number of the list, when the `ordered` field is `true`.
|
|
802
|
+
*/
|
|
803
|
+
start?: number | null | undefined;
|
|
804
|
+
/**
|
|
805
|
+
* Whether one or more of the children are separated with a blank line from
|
|
806
|
+
* its siblings (when `true`), or not (when `false` or not present).
|
|
807
|
+
*/
|
|
808
|
+
spread?: boolean | null | undefined;
|
|
809
|
+
/**
|
|
810
|
+
* Children of list.
|
|
811
|
+
*/
|
|
812
|
+
children: ListContent[];
|
|
813
|
+
/**
|
|
814
|
+
* Data associated with the mdast list.
|
|
815
|
+
*/
|
|
816
|
+
data?: ListData | undefined;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Info associated with mdast list nodes by the ecosystem.
|
|
820
|
+
*/
|
|
821
|
+
interface ListData extends Data$1 {}
|
|
822
|
+
/**
|
|
823
|
+
* Markdown list item.
|
|
824
|
+
*/
|
|
825
|
+
interface ListItem extends Parent$1 {
|
|
826
|
+
/**
|
|
827
|
+
* Node type of mdast list item.
|
|
828
|
+
*/
|
|
829
|
+
type: "listItem";
|
|
830
|
+
/**
|
|
831
|
+
* Whether the item is a tasklist item (when `boolean`).
|
|
832
|
+
*
|
|
833
|
+
* When `true`, the item is complete.
|
|
834
|
+
* When `false`, the item is incomplete.
|
|
835
|
+
*/
|
|
836
|
+
checked?: boolean | null | undefined;
|
|
837
|
+
/**
|
|
838
|
+
* Whether one or more of the children are separated with a blank line from
|
|
839
|
+
* its siblings (when `true`), or not (when `false` or not present).
|
|
840
|
+
*/
|
|
841
|
+
spread?: boolean | null | undefined;
|
|
842
|
+
/**
|
|
843
|
+
* Children of list item.
|
|
844
|
+
*/
|
|
845
|
+
children: Array<BlockContent | DefinitionContent>;
|
|
846
|
+
/**
|
|
847
|
+
* Data associated with the mdast list item.
|
|
848
|
+
*/
|
|
849
|
+
data?: ListItemData | undefined;
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Info associated with mdast list item nodes by the ecosystem.
|
|
853
|
+
*/
|
|
854
|
+
interface ListItemData extends Data$1 {}
|
|
855
|
+
/**
|
|
856
|
+
* Markdown paragraph.
|
|
857
|
+
*/
|
|
858
|
+
interface Paragraph extends Parent$1 {
|
|
859
|
+
/**
|
|
860
|
+
* Node type of mdast paragraph.
|
|
861
|
+
*/
|
|
862
|
+
type: "paragraph";
|
|
863
|
+
/**
|
|
864
|
+
* Children of paragraph.
|
|
865
|
+
*/
|
|
866
|
+
children: PhrasingContent[];
|
|
867
|
+
/**
|
|
868
|
+
* Data associated with the mdast paragraph.
|
|
869
|
+
*/
|
|
870
|
+
data?: ParagraphData | undefined;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Info associated with mdast paragraph nodes by the ecosystem.
|
|
874
|
+
*/
|
|
875
|
+
interface ParagraphData extends Data$1 {}
|
|
876
|
+
/**
|
|
877
|
+
* Document fragment or a whole document.
|
|
878
|
+
*
|
|
879
|
+
* Should be used as the root of a tree and must not be used as a child.
|
|
880
|
+
*/
|
|
881
|
+
interface Root$1 extends Parent$1 {
|
|
882
|
+
/**
|
|
883
|
+
* Node type of mdast root.
|
|
884
|
+
*/
|
|
885
|
+
type: "root";
|
|
886
|
+
/**
|
|
887
|
+
* Data associated with the mdast root.
|
|
888
|
+
*/
|
|
889
|
+
data?: RootData$1 | undefined;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Info associated with mdast root nodes by the ecosystem.
|
|
893
|
+
*/
|
|
894
|
+
interface RootData$1 extends Data$1 {}
|
|
895
|
+
/**
|
|
896
|
+
* Markdown strong.
|
|
897
|
+
*/
|
|
898
|
+
interface Strong extends Parent$1 {
|
|
899
|
+
/**
|
|
900
|
+
* Node type of mdast strong.
|
|
901
|
+
*/
|
|
902
|
+
type: "strong";
|
|
903
|
+
/**
|
|
904
|
+
* Children of strong.
|
|
905
|
+
*/
|
|
906
|
+
children: PhrasingContent[];
|
|
907
|
+
/**
|
|
908
|
+
* Data associated with the mdast strong.
|
|
909
|
+
*/
|
|
910
|
+
data?: StrongData | undefined;
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Info associated with mdast strong nodes by the ecosystem.
|
|
914
|
+
*/
|
|
915
|
+
interface StrongData extends Data$1 {}
|
|
916
|
+
/**
|
|
917
|
+
* Markdown GFM table.
|
|
918
|
+
*/
|
|
919
|
+
interface Table extends Parent$1 {
|
|
920
|
+
/**
|
|
921
|
+
* Node type of mdast GFM table.
|
|
922
|
+
*/
|
|
923
|
+
type: "table";
|
|
924
|
+
/**
|
|
925
|
+
* How cells in columns are aligned.
|
|
926
|
+
*/
|
|
927
|
+
align?: AlignType[] | null | undefined;
|
|
928
|
+
/**
|
|
929
|
+
* Children of GFM table.
|
|
930
|
+
*/
|
|
931
|
+
children: TableContent[];
|
|
932
|
+
/**
|
|
933
|
+
* Data associated with the mdast GFM table.
|
|
934
|
+
*/
|
|
935
|
+
data?: TableData | undefined;
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Info associated with mdast GFM table nodes by the ecosystem.
|
|
939
|
+
*/
|
|
940
|
+
interface TableData extends Data$1 {}
|
|
941
|
+
/**
|
|
942
|
+
* Markdown GFM table row.
|
|
943
|
+
*/
|
|
944
|
+
interface TableRow extends Parent$1 {
|
|
945
|
+
/**
|
|
946
|
+
* Node type of mdast GFM table row.
|
|
947
|
+
*/
|
|
948
|
+
type: "tableRow";
|
|
949
|
+
/**
|
|
950
|
+
* Children of GFM table row.
|
|
951
|
+
*/
|
|
952
|
+
children: RowContent[];
|
|
953
|
+
/**
|
|
954
|
+
* Data associated with the mdast GFM table row.
|
|
955
|
+
*/
|
|
956
|
+
data?: TableRowData | undefined;
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Info associated with mdast GFM table row nodes by the ecosystem.
|
|
960
|
+
*/
|
|
961
|
+
interface TableRowData extends Data$1 {}
|
|
962
|
+
/**
|
|
963
|
+
* Markdown GFM table cell.
|
|
964
|
+
*/
|
|
965
|
+
interface TableCell extends Parent$1 {
|
|
966
|
+
/**
|
|
967
|
+
* Node type of mdast GFM table cell.
|
|
968
|
+
*/
|
|
969
|
+
type: "tableCell";
|
|
970
|
+
/**
|
|
971
|
+
* Children of GFM table cell.
|
|
972
|
+
*/
|
|
973
|
+
children: PhrasingContent[];
|
|
974
|
+
/**
|
|
975
|
+
* Data associated with the mdast GFM table cell.
|
|
976
|
+
*/
|
|
977
|
+
data?: TableCellData | undefined;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Info associated with mdast GFM table cell nodes by the ecosystem.
|
|
981
|
+
*/
|
|
982
|
+
interface TableCellData extends Data$1 {}
|
|
983
|
+
/**
|
|
984
|
+
* Markdown text.
|
|
985
|
+
*/
|
|
986
|
+
interface Text$1 extends Literal$1 {
|
|
987
|
+
/**
|
|
988
|
+
* Node type of mdast text.
|
|
989
|
+
*/
|
|
990
|
+
type: "text";
|
|
991
|
+
/**
|
|
992
|
+
* Data associated with the mdast text.
|
|
993
|
+
*/
|
|
994
|
+
data?: TextData$1 | undefined;
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Info associated with mdast text nodes by the ecosystem.
|
|
998
|
+
*/
|
|
999
|
+
interface TextData$1 extends Data$1 {}
|
|
1000
|
+
/**
|
|
1001
|
+
* Markdown thematic break (horizontal rule).
|
|
1002
|
+
*/
|
|
1003
|
+
interface ThematicBreak extends Node$1 {
|
|
1004
|
+
/**
|
|
1005
|
+
* Node type of mdast thematic break.
|
|
1006
|
+
*/
|
|
1007
|
+
type: "thematicBreak";
|
|
1008
|
+
/**
|
|
1009
|
+
* Data associated with the mdast thematic break.
|
|
1010
|
+
*/
|
|
1011
|
+
data?: ThematicBreakData | undefined;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Info associated with mdast thematic break nodes by the ecosystem.
|
|
1015
|
+
*/
|
|
1016
|
+
interface ThematicBreakData extends Data$1 {}
|
|
1017
|
+
/**
|
|
1018
|
+
* Markdown YAML.
|
|
1019
|
+
*/
|
|
1020
|
+
interface Yaml extends Literal$1 {
|
|
1021
|
+
/**
|
|
1022
|
+
* Node type of mdast YAML.
|
|
1023
|
+
*/
|
|
1024
|
+
type: "yaml";
|
|
1025
|
+
/**
|
|
1026
|
+
* Data associated with the mdast YAML.
|
|
1027
|
+
*/
|
|
1028
|
+
data?: YamlData | undefined;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Info associated with mdast YAML nodes by the ecosystem.
|
|
1032
|
+
*/
|
|
1033
|
+
interface YamlData extends Data$1 {}
|
|
1034
|
+
//#endregion
|
|
1035
|
+
//#region src/renderMarkdown.d.ts
|
|
1036
|
+
interface RenderOptions {
|
|
1037
|
+
/** Enable GFM tables, strikethrough, task lists (default: true) */
|
|
1038
|
+
gfm?: boolean;
|
|
1039
|
+
/** Enable KaTeX math rendering (default: true) */
|
|
1040
|
+
math?: boolean;
|
|
1041
|
+
/** Enable syntax highlighting (default: true) */
|
|
1042
|
+
highlight?: boolean;
|
|
1043
|
+
/** Add data-source-line attributes for line anchors (default: true) */
|
|
1044
|
+
sourceLines?: boolean;
|
|
1045
|
+
/** Enable XSS sanitization (default: true) */
|
|
1046
|
+
sanitize?: boolean;
|
|
1047
|
+
/** Parse and strip frontmatter (default: true) */
|
|
1048
|
+
frontmatter?: boolean;
|
|
1049
|
+
/**
|
|
1050
|
+
* The body's mdast, already parsed — an optimisation, not a second input.
|
|
1051
|
+
*
|
|
1052
|
+
* Parsing is the most expensive step in this function: measured over
|
|
1053
|
+
* `docs/design/`, `remark-parse` with GFM costs about twice what the whole
|
|
1054
|
+
* rehype half costs. A caller that already holds the tree — the CLI checker
|
|
1055
|
+
* does, because every `mdast` rule ran on it before the render rule got its
|
|
1056
|
+
* turn — was paying for the same parse twice.
|
|
1057
|
+
*
|
|
1058
|
+
* The tree must have been parsed by **this package's remark half with these
|
|
1059
|
+
* same options** (`buildRemarkPlugins`, which is exported for exactly that
|
|
1060
|
+
* reason). Anything parsed some other way renders through a chain the viewer
|
|
1061
|
+
* does not use, which is the one thing the shared pipeline exists to prevent,
|
|
1062
|
+
* and nothing here can detect it: a tree is a tree.
|
|
1063
|
+
*
|
|
1064
|
+
* `content` is still read, for its frontmatter. The two have to describe the
|
|
1065
|
+
* same document.
|
|
1066
|
+
*/
|
|
1067
|
+
tree?: Root$1;
|
|
1068
|
+
}
|
|
1069
|
+
interface RenderResult {
|
|
1070
|
+
/** The rendered HTML string */
|
|
1071
|
+
html: string;
|
|
1072
|
+
/** Parsed frontmatter (empty object if none or disabled) */
|
|
1073
|
+
frontmatter: Record<string, unknown>;
|
|
1074
|
+
/** The markdown body with frontmatter stripped */
|
|
1075
|
+
body: string;
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Render a markdown string to HTML using the full Vantage pipeline.
|
|
1079
|
+
*
|
|
1080
|
+
* Features (all enabled by default):
|
|
1081
|
+
* - GitHub Flavored Markdown (tables, strikethrough, task lists)
|
|
1082
|
+
* - KaTeX math rendering, inline and block ($$...$$ only; single $ is not a delimiter)
|
|
1083
|
+
* - Syntax highlighting via highlight.js
|
|
1084
|
+
* - `data-source-line` attributes for line anchors
|
|
1085
|
+
* - XSS sanitization
|
|
1086
|
+
* - Heading slugs/anchors
|
|
1087
|
+
* - YAML/TOML frontmatter parsing
|
|
1088
|
+
*
|
|
1089
|
+
* Mermaid diagrams are NOT rendered server-side (they require a browser).
|
|
1090
|
+
* Mermaid code blocks are preserved as `<pre><code class="language-mermaid">`.
|
|
1091
|
+
* Use the React `<MarkdownViewer>` component for client-side mermaid rendering.
|
|
1092
|
+
*/
|
|
1093
|
+
export declare function renderMarkdown(content: string, options?: RenderOptions): Promise<RenderResult>;
|
|
1094
|
+
//#endregion
|
|
130
1095
|
//#region ../../node_modules/@types/hast/index.d.ts
|
|
131
1096
|
// ## Interfaces
|
|
132
1097
|
/**
|
|
@@ -147,7 +1112,7 @@ interface Node$1 {
|
|
|
147
1112
|
* }
|
|
148
1113
|
* ```
|
|
149
1114
|
*/
|
|
150
|
-
interface Data extends Data$
|
|
1115
|
+
interface Data extends Data$2 {}
|
|
151
1116
|
/**
|
|
152
1117
|
* Info associated with an element.
|
|
153
1118
|
*/
|
|
@@ -849,7 +1814,7 @@ interface RootContentMap {
|
|
|
849
1814
|
*
|
|
850
1815
|
* For a union of all registered hast nodes, see {@link Nodes}.
|
|
851
1816
|
*/
|
|
852
|
-
interface Node extends Node$
|
|
1817
|
+
interface Node extends Node$2 {
|
|
853
1818
|
/**
|
|
854
1819
|
* Info from the ecosystem.
|
|
855
1820
|
*/
|
|
@@ -902,7 +1867,7 @@ interface CommentData extends Data {}
|
|
|
902
1867
|
/**
|
|
903
1868
|
* HTML document type.
|
|
904
1869
|
*/
|
|
905
|
-
interface Doctype extends Node$
|
|
1870
|
+
interface Doctype extends Node$2 {
|
|
906
1871
|
/**
|
|
907
1872
|
* Node type of HTML document types in hast.
|
|
908
1873
|
*/
|
|
@@ -1003,10 +1968,10 @@ interface TextData extends Data {}
|
|
|
1003
1968
|
* closed by different authorities and a change to one must not silently move the
|
|
1004
1969
|
* other. A test asserts the five are a subset of the tones.
|
|
1005
1970
|
*/
|
|
1006
|
-
declare const VANTAGE_ALERTS: readonly ["note", "tip", "important", "warning", "caution"];
|
|
1971
|
+
export declare const VANTAGE_ALERTS: readonly ["note", "tip", "important", "warning", "caution"];
|
|
1007
1972
|
type VantageAlert = (typeof VANTAGE_ALERTS)[number];
|
|
1008
1973
|
/** The visible label per kind. Title case, as GitHub renders it. */
|
|
1009
|
-
declare const ALERT_TITLES: Readonly<Record<VantageAlert, string>>;
|
|
1974
|
+
export declare const ALERT_TITLES: Readonly<Record<VantageAlert, string>>;
|
|
1010
1975
|
/**
|
|
1011
1976
|
* Compile `> [!KIND]` blockquotes into `data-vantage-alert="kind"`.
|
|
1012
1977
|
*
|
|
@@ -1020,7 +1985,7 @@ declare const ALERT_TITLES: Readonly<Record<VantageAlert, string>>;
|
|
|
1020
1985
|
* passed. `dataVantageAlert` is allowlisted there by name *and* value, like
|
|
1021
1986
|
* every other `data-vantage-*` attribute.
|
|
1022
1987
|
*/
|
|
1023
|
-
declare function rehypeVantageAlerts(): (tree: Root) => void;
|
|
1988
|
+
export declare function rehypeVantageAlerts(): (tree: Root) => void;
|
|
1024
1989
|
//#endregion
|
|
1025
1990
|
//#region src/rehypeSourceLines.d.ts
|
|
1026
1991
|
interface RehypeSourceLinesOptions {
|
|
@@ -1069,7 +2034,7 @@ declare function rehypeVantageAnchors(): (tree: Root) => void;
|
|
|
1069
2034
|
* as markup, and it makes the common case a prefix test rather than a grammar
|
|
1070
2035
|
* attempt (Ledger OQ-1).
|
|
1071
2036
|
*/
|
|
1072
|
-
declare const VANTAGE_SENTINEL = "vantage:";
|
|
2037
|
+
export declare const VANTAGE_SENTINEL = "vantage:";
|
|
1073
2038
|
/**
|
|
1074
2039
|
* The closed name set. An unknown name drops the **whole** directive: there is
|
|
1075
2040
|
* no target semantics without a name. An unknown key or value drops only that
|
|
@@ -1081,7 +2046,7 @@ declare const VANTAGE_SENTINEL = "vantage:";
|
|
|
1081
2046
|
* it only says how far the stamp reaches — so §4.2's refusal of a `scope=` key
|
|
1082
2047
|
* stands.
|
|
1083
2048
|
*/
|
|
1084
|
-
declare const DIRECTIVE_NAMES: readonly ["section", "block", "oq"];
|
|
2049
|
+
export declare const DIRECTIVE_NAMES: readonly ["section", "block", "oq"];
|
|
1085
2050
|
/**
|
|
1086
2051
|
* The `tone` vocabulary: GitHub's alert words plus `muted`.
|
|
1087
2052
|
*
|
|
@@ -1089,11 +2054,11 @@ declare const DIRECTIVE_NAMES: readonly ["section", "block", "oq"];
|
|
|
1089
2054
|
* *is*; the theme decides what that looks like, which is what lets one document
|
|
1090
2055
|
* render correctly in light, in dark, and in themes that do not exist yet.
|
|
1091
2056
|
*/
|
|
1092
|
-
declare const VANTAGE_TONES: readonly ["note", "tip", "important", "warning", "caution", "muted"];
|
|
2057
|
+
export declare const VANTAGE_TONES: readonly ["note", "tip", "important", "warning", "caution", "muted"];
|
|
1093
2058
|
/** How much the block should pull the eye — separate from `tone` on purpose. */
|
|
1094
|
-
declare const VANTAGE_EMPHASIS: readonly ["strong", "normal", "quiet"];
|
|
2059
|
+
export declare const VANTAGE_EMPHASIS: readonly ["strong", "normal", "quiet"];
|
|
1095
2060
|
/** A small chip beside the heading. */
|
|
1096
|
-
declare const VANTAGE_BADGES: readonly ["draft", "stale", "blocked", "done", "wip"];
|
|
2061
|
+
export declare const VANTAGE_BADGES: readonly ["draft", "stale", "blocked", "done", "wip"];
|
|
1097
2062
|
/**
|
|
1098
2063
|
* `collapsed` is a token, not a flag: `false` is the default written down.
|
|
1099
2064
|
*
|
|
@@ -1104,7 +2069,7 @@ declare const VANTAGE_BADGES: readonly ["draft", "stale", "blocked", "done", "wi
|
|
|
1104
2069
|
* member of the outer group by design (A3), and the outer run is stamped before
|
|
1105
2070
|
* any inner directive has been resolved.
|
|
1106
2071
|
*/
|
|
1107
|
-
declare const VANTAGE_COLLAPSED: readonly ["true", "false"];
|
|
2072
|
+
export declare const VANTAGE_COLLAPSED: readonly ["true", "false"];
|
|
1108
2073
|
/**
|
|
1109
2074
|
* Where a block sits in a stamped run, so section-wide CSS can join its members
|
|
1110
2075
|
* without an adjacent-sibling combinator.
|
|
@@ -1114,7 +2079,7 @@ declare const VANTAGE_COLLAPSED: readonly ["true", "false"];
|
|
|
1114
2079
|
* commented paragraph and bleeds across the boundary between two adjacent runs
|
|
1115
2080
|
* of different tone. An attribute survives both.
|
|
1116
2081
|
*/
|
|
1117
|
-
declare const VANTAGE_RUNS: readonly ["start", "middle", "end", "only"];
|
|
2082
|
+
export declare const VANTAGE_RUNS: readonly ["start", "middle", "end", "only"];
|
|
1118
2083
|
/**
|
|
1119
2084
|
* The tags a `<!-- vantage: oq … -->` directive actually yields a *button* on —
|
|
1120
2085
|
* `VANTAGE_ANCHOR_TARGETS` minus `pre` and `table`, written as an explicit
|
|
@@ -1132,7 +2097,7 @@ declare const VANTAGE_RUNS: readonly ["start", "middle", "end", "only"];
|
|
|
1132
2097
|
* checker called an `oq` above a fence fine while the app rendered no button
|
|
1133
2098
|
* and said nothing, which is the D5 break this module exists to prevent.
|
|
1134
2099
|
*/
|
|
1135
|
-
declare const VANTAGE_OQ_HOST_TARGETS: ("p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "blockquote")[];
|
|
2100
|
+
export declare const VANTAGE_OQ_HOST_TARGETS: ("p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "blockquote")[];
|
|
1136
2101
|
/** `null` for a key the grammar accepts but no closed set covers. */
|
|
1137
2102
|
type KeyVocabulary = readonly string[] | null;
|
|
1138
2103
|
/** The keys one directive name accepts. `undefined` for an unknown key. */
|
|
@@ -1148,7 +2113,7 @@ type DirectiveVocabulary = Readonly<Record<string, KeyTable | undefined>>;
|
|
|
1148
2113
|
* neither can be value-allowlisted, which is recorded here as `null` rather
|
|
1149
2114
|
* than left to a caller to guess.
|
|
1150
2115
|
*/
|
|
1151
|
-
declare const DIRECTIVE_VOCABULARY: DirectiveVocabulary;
|
|
2116
|
+
export declare const DIRECTIVE_VOCABULARY: DirectiveVocabulary;
|
|
1152
2117
|
interface DirectivePair {
|
|
1153
2118
|
key: string;
|
|
1154
2119
|
/** The value with quotes stripped, if it was quoted. */
|
|
@@ -1184,7 +2149,7 @@ type DirectiveParse = ParsedDirective | MalformedDirective | null;
|
|
|
1184
2149
|
* Note `<!--- vantage: x -->` is *not* a directive: its inner text begins with
|
|
1185
2150
|
* the extra `-`, and the sentinel must be the first thing in the comment.
|
|
1186
2151
|
*/
|
|
1187
|
-
declare function hasVantageSentinel(comment: string): boolean;
|
|
2152
|
+
export declare function hasVantageSentinel(comment: string): boolean;
|
|
1188
2153
|
/**
|
|
1189
2154
|
* Parse one comment's **inner** text — the value of a hast `comment` node, with
|
|
1190
2155
|
* `<!--` and `-->` already stripped. `null` means "no sentinel, not ours".
|
|
@@ -1193,7 +2158,7 @@ declare function hasVantageSentinel(comment: string): boolean;
|
|
|
1193
2158
|
* group keeps only its last match and the checker needs an offset per token to
|
|
1194
2159
|
* point at the character that broke.
|
|
1195
2160
|
*/
|
|
1196
|
-
declare function parseVantageDirective(comment: string): DirectiveParse;
|
|
2161
|
+
export declare function parseVantageDirective(comment: string): DirectiveParse;
|
|
1197
2162
|
//#endregion
|
|
1198
2163
|
//#region src/pipeline.d.ts
|
|
1199
2164
|
interface PipelineOptions {
|
|
@@ -1225,7 +2190,7 @@ interface Pipeline {
|
|
|
1225
2190
|
* rehype (`packages/vantage-check/src/core/document.ts`), and it has to parse
|
|
1226
2191
|
* them exactly the way the viewer does.
|
|
1227
2192
|
*/
|
|
1228
|
-
declare function buildRemarkPlugins(options?: PipelineOptions): PluggableList;
|
|
2193
|
+
export declare function buildRemarkPlugins(options?: PipelineOptions): PluggableList;
|
|
1229
2194
|
/**
|
|
1230
2195
|
* Both halves from one options object.
|
|
1231
2196
|
*
|
|
@@ -1238,7 +2203,7 @@ declare function buildRemarkPlugins(options?: PipelineOptions): PluggableList;
|
|
|
1238
2203
|
* that way, so a plugin in the chain cannot become a function of how many times
|
|
1239
2204
|
* the chain has been built.
|
|
1240
2205
|
*/
|
|
1241
|
-
declare function buildPipeline(options?: PipelineOptions): Pipeline;
|
|
2206
|
+
export declare function buildPipeline(options?: PipelineOptions): Pipeline;
|
|
1242
2207
|
//#endregion
|
|
1243
2208
|
//#region src/scrollToLineAnchor.d.ts
|
|
1244
2209
|
/**
|
|
@@ -1250,7 +2215,7 @@ declare function buildPipeline(options?: PipelineOptions): Pipeline;
|
|
|
1250
2215
|
/**
|
|
1251
2216
|
* Clear all line anchor highlights from a container.
|
|
1252
2217
|
*/
|
|
1253
|
-
declare function clearLineAnchorHighlights(container: HTMLElement): void;
|
|
2218
|
+
export declare function clearLineAnchorHighlights(container: HTMLElement): void;
|
|
1254
2219
|
/**
|
|
1255
2220
|
* Scroll to and highlight line-anchored elements in a container.
|
|
1256
2221
|
*
|
|
@@ -1258,7 +2223,7 @@ declare function clearLineAnchorHighlights(container: HTMLElement): void;
|
|
|
1258
2223
|
* @param hash - The URL hash (e.g. "#L42" or "#L42-L50")
|
|
1259
2224
|
* @returns A cleanup function that removes the highlights
|
|
1260
2225
|
*/
|
|
1261
|
-
declare function scrollToLineAnchor(container: HTMLElement, hash: string): (() => void) | null;
|
|
2226
|
+
export declare function scrollToLineAnchor(container: HTMLElement, hash: string): (() => void) | null;
|
|
1262
2227
|
//#endregion
|
|
1263
2228
|
//#region src/lineAnchor.d.ts
|
|
1264
2229
|
/**
|
|
@@ -1274,7 +2239,7 @@ declare function scrollToLineAnchor(container: HTMLElement, hash: string): (() =
|
|
|
1274
2239
|
* Supports: #L42, #L42-L50, #L42-50
|
|
1275
2240
|
* Returns null if the hash is not a line anchor.
|
|
1276
2241
|
*/
|
|
1277
|
-
declare function parseLineAnchor(hash: string): {
|
|
2242
|
+
export declare function parseLineAnchor(hash: string): {
|
|
1278
2243
|
start: number;
|
|
1279
2244
|
end: number;
|
|
1280
2245
|
} | null;
|
|
@@ -1333,7 +2298,7 @@ interface ParsedFrontmatter {
|
|
|
1333
2298
|
* Parse frontmatter from markdown content.
|
|
1334
2299
|
* Supports YAML (delimited by ---) and TOML (delimited by +++).
|
|
1335
2300
|
*/
|
|
1336
|
-
declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
2301
|
+
export declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
1337
2302
|
//#endregion
|
|
1338
2303
|
//#region src/vantageFrontmatter.d.ts
|
|
1339
2304
|
/**
|
|
@@ -1347,10 +2312,10 @@ declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
|
1347
2312
|
* `in-review` — the value the design doc's own only example renders — is not a
|
|
1348
2313
|
* badge word at all. Only `draft` is a member of both, and a token set is per key.
|
|
1349
2314
|
*/
|
|
1350
|
-
declare const DOC_STATUSES: readonly ["draft", "in-review", "accepted", "deprecated"];
|
|
2315
|
+
export declare const DOC_STATUSES: readonly ["draft", "in-review", "accepted", "deprecated"];
|
|
1351
2316
|
type DocStatus = (typeof DOC_STATUSES)[number];
|
|
1352
2317
|
/** Every key this build knows under `vantage:`. Closed. */
|
|
1353
|
-
declare const VANTAGE_FRONTMATTER_KEYS: readonly ["status-chip"];
|
|
2318
|
+
export declare const VANTAGE_FRONTMATTER_KEYS: readonly ["status-chip"];
|
|
1354
2319
|
/**
|
|
1355
2320
|
* Which tone each status borrows its colours from.
|
|
1356
2321
|
*
|
|
@@ -1360,7 +2325,7 @@ declare const VANTAGE_FRONTMATTER_KEYS: readonly ["status-chip"];
|
|
|
1360
2325
|
* than a computed class name, so the whole status→tone relation is one readable
|
|
1361
2326
|
* table and a test can assert it covers the vocabulary.
|
|
1362
2327
|
*/
|
|
1363
|
-
declare const DOC_STATUS_TONES: Readonly<Record<DocStatus, (typeof VANTAGE_TONES)[number]>>;
|
|
2328
|
+
export declare const DOC_STATUS_TONES: Readonly<Record<DocStatus, (typeof VANTAGE_TONES)[number]>>;
|
|
1364
2329
|
/**
|
|
1365
2330
|
* Why something under `vantage:` produced no chrome.
|
|
1366
2331
|
*
|
|
@@ -1394,18 +2359,18 @@ interface VantageFrontmatter {
|
|
|
1394
2359
|
issues: VantageFrontmatterIssue[];
|
|
1395
2360
|
}
|
|
1396
2361
|
/** Narrowing helper the chip and the checker both use. */
|
|
1397
|
-
declare function isDocStatus(value: unknown): value is DocStatus;
|
|
2362
|
+
export declare function isDocStatus(value: unknown): value is DocStatus;
|
|
1398
2363
|
/**
|
|
1399
2364
|
* Read the `vantage:` key out of parsed frontmatter.
|
|
1400
2365
|
*
|
|
1401
2366
|
* Pure: no module state, no mutation of the input, no logging. The same object
|
|
1402
2367
|
* in twice gives equal results out.
|
|
1403
2368
|
*/
|
|
1404
|
-
declare function readVantageFrontmatter(frontmatter: Record<string, unknown>): VantageFrontmatter;
|
|
2369
|
+
export declare function readVantageFrontmatter(frontmatter: Record<string, unknown>): VantageFrontmatter;
|
|
1405
2370
|
//#endregion
|
|
1406
2371
|
//#region src/sanitize.d.ts
|
|
1407
2372
|
type Schema = typeof defaultSchema;
|
|
1408
|
-
declare const SAFE_STYLE: RegExp;
|
|
2373
|
+
export declare const SAFE_STYLE: RegExp;
|
|
1409
2374
|
/**
|
|
1410
2375
|
* Never set `allowComments` here.
|
|
1411
2376
|
*
|
|
@@ -1418,7 +2383,7 @@ declare const SAFE_STYLE: RegExp;
|
|
|
1418
2383
|
* whole premise. `vantageDirectives.test.ts` ("leaves no comment in the rendered
|
|
1419
2384
|
* markup") is the guard.
|
|
1420
2385
|
*/
|
|
1421
|
-
declare const sanitizeSchema: Schema;
|
|
2386
|
+
export declare const sanitizeSchema: Schema;
|
|
1422
2387
|
//#endregion
|
|
1423
2388
|
//#region src/renderMermaidBlocks.d.ts
|
|
1424
2389
|
/**
|
|
@@ -1453,7 +2418,7 @@ interface RenderMermaidOptions {
|
|
|
1453
2418
|
* await renderMermaidBlocks(container);
|
|
1454
2419
|
* ```
|
|
1455
2420
|
*/
|
|
1456
|
-
declare function renderMermaidBlocks(container: HTMLElement, options?: RenderMermaidOptions): Promise<void>;
|
|
2421
|
+
export declare function renderMermaidBlocks(container: HTMLElement, options?: RenderMermaidOptions): Promise<void>;
|
|
1457
2422
|
//#endregion
|
|
1458
2423
|
//#region src/resolveLinks.d.ts
|
|
1459
2424
|
/**
|
|
@@ -1499,7 +2464,7 @@ interface ResolveLinkOptions {
|
|
|
1499
2464
|
* });
|
|
1500
2465
|
* ```
|
|
1501
2466
|
*/
|
|
1502
|
-
declare function resolveLinks(html: string, options?: ResolveLinkOptions): string;
|
|
2467
|
+
export declare function resolveLinks(html: string, options?: ResolveLinkOptions): string;
|
|
1503
2468
|
//#endregion
|
|
1504
2469
|
//#region src/styleGuide.d.ts
|
|
1505
2470
|
/**
|
|
@@ -1516,7 +2481,7 @@ declare function resolveLinks(html: string, options?: ResolveLinkOptions): strin
|
|
|
1516
2481
|
* Every rule stated here should be one a checker can enforce or a renderer
|
|
1517
2482
|
* actually cares about — if a line is neither, it does not belong.
|
|
1518
2483
|
*/
|
|
1519
|
-
declare const STYLE_GUIDE = "## Markdown style guide (for Vantage viewer)\n\nWhen writing or updating markdown documents that will be viewed in Vantage, follow these conventions:\n\n### Structure\n- Use headings (## and ###) to organize content — they become navigable outline anchors.\n- Keep paragraphs focused and concise. Break up dense text with subheadings, lists, or tables.\n\n### Links and cross-references\n- **Relative paths only**: Always link relative to the *current file's directory*:\n - Sibling in same folder: `[Other Doc](./other-doc.md)` or `[Other Doc](other-doc.md)`\n - Subdirectory: `[Design Doc](./design/auth.md)`\n - Parent / sibling folder: `[Overview](../overview.md)` or `[Spec](../specs/api.md)`\n- **Never use leading slashes**:\n - ❌ `[Doc](/docs/guide.md)` (breaks web routing and multi-repo scoping)\n - ✅ `[Doc](../docs/guide.md)` or `[Doc](./guide.md)`\n- **Never use absolute filesystem paths or URI schemes**:\n - ❌ `file:///workspace/docs/guide.md`, `/workspace/docs/guide.md`, `C:\\...`\n - ✅ `[Doc](./guide.md)` or `[Doc](../guide.md)`\n- **Always include the file extension**: Use `.md`, `.ts`, `.go`, etc. (e.g. `[Model](model.go)`).\n- **Line anchors and ranges**:\n - Link to specific lines: `[Handler](../server/api.go#L42)` or `[Range](../server/api.go#L42-L58)`\n - Same-file line anchor: `[See lines](#L10-L25)`\n - Vantage scrolls to and highlights the target lines.\n- **Section anchors**:\n - Same doc: `[Usage](#usage)`\n - Cross-doc: `[Architecture](../overview.md#system-architecture)`\n - Anchor slugs are lowercase, hyphenated, and punctuation-stripped.\n- **Backticks in links**: Place backticks inside the link label, not around the markdown link syntax:\n - ✅ `[`config.json`](./config.json)` or `[config.json](./config.json)`\n - ❌ ``[config.json](./config.json)``\n\n### Frontmatter (Metadata)\n- Include structured metadata at the very top of docs delimited by `---` (YAML) or `+++` (TOML). Vantage renders this as a metadata card:\n```yaml\n---\ntitle: \"Feature Specification\"\nauthor: \"Agent\"\ndate: 2026-08-15\nstatus: in-review # draft | in-review | accepted | deprecated\ntags: [architecture, backend, api]\nsummary: \"Brief description of the document purpose.\"\nvantage:\n status-chip: true # show `status` as a chip above the metadata card\n---\n```\n- **Nothing may sit above the opening delimiter** — not a blank line, not an editorial comment, not a `<!-- vantage: … -->` directive. Frontmatter is recognised only at the very first byte of the file (in Vantage, on GitHub, and in every other reader), so one line above it turns the whole block into body text: a horizontal rule followed by a heading made of the raw keys, with every field lost. `vantage-check` reports it as `frontmatter/not-at-top`.\n- **`vantage:` is Vantage's own reserved key.** It holds chrome that belongs to the file rather than to a section, it never shows up in the metadata card, and every other renderer ignores it. One key today: `status-chip`.\n- **Prefer `status-chip: true`**, which shows the document's own `status:` and therefore cannot disagree with it. A literal `status-chip: accepted` is accepted too, but it is a second value that goes stale on its own — `vantage-check` reports the disagreement.\n- The chip's vocabulary is `status`'s, exactly: `draft | in-review | accepted | deprecated`, lowercase. `Draft` renders no chip at all, silently.\n\n### Mermaid diagrams\n- Use ```mermaid code blocks for flowcharts, sequence diagrams, and architecture diagrams. Vantage provides interactive zoom, pan, dark/light theme adaptation, and SVG export.\n- **Quote labels with special characters**: Always quote node labels containing parentheses, brackets, or colons to prevent syntax errors:\n```mermaid\nflowchart TD\n client[\"Client (React SPA)\"] -->|WebSocket| srv[\"Vantage Server (Go)\"]\n srv --> git[\"Git CLI (git diff)\"]\n```\n\n### Code blocks and diffs\n- Always tag fenced code blocks with language identifiers (`ts`, `go`, `python`, `bash`, `json`, `yaml`, `diff`, `sql`, etc.) for syntax highlighting.\n- For proposed code modifications, use ```diff blocks with `+` and `-` prefixes:\n```diff\n-const oldUrl = \"/api/v1\";\n+const newUrl = \"/api/v2\";\n```\n\n### Callouts and alerts\n- Use GitHub-style blockquote callouts for notes, tips, and warnings:\n> [!NOTE]\n> Background context or helpful explanation.\n\n> [!TIP]\n> Best practice advice or optimization suggestions.\n\n> [!IMPORTANT]\n> Key requirements or crucial information.\n\n> [!WARNING]\n> Urgent caution, breaking changes, or potential pitfalls.\n\n> [!CAUTION]\n> High-risk actions that could cause data loss or security issues.\n\n### Vantage directives (optional, and Vantage-only)\n\nVantage reads a few styling hints from ordinary HTML comments. Every other renderer — GitHub included — drops them, so a document has to read exactly the same without them: directives decorate, they never carry meaning. One goes on a line of its own, with a blank line after it, and applies to the block that follows:\n\n```markdown\n<!-- vantage: section tone=warning badge=stale -->\n\n## Migration path\n\nThe steps below predate the rewrite.\n```\n\n- **Three names**: `section` (the heading and everything under it), `block` (the one block after it), `oq` (one answerable Open Question).\n- **The keys and values are a closed set**: `tone` = `note | tip | important | warning | caution | muted`; `emphasis` = `strong | normal | quiet`; `badge` = `draft | stale | blocked | done | wip`; `collapsed` = `true | false`. Name a *tone*, never a colour — the theme decides what a warning looks like, in light mode, in dark mode, and in print.\n- **Use them sparingly.** One or two per document, on the sections that genuinely differ. A document where everything is toned says nothing, and a rainbow one is harder to read than a plain one.\n- **Anything outside those sets is silently ignored** — nothing breaks, and nothing styles either. Run `vantage-check` on the document: the `vantage/*` rules are the only thing that will ever tell you a directive did nothing.\n- **Always close the comment with `-->`.** Never `--!>`, and never leave it open: Markdown reads every line below an unclosed `<!--` as part of the comment, and the whole rest of the document vanishes from the page. For the same reason `-->` cannot appear *inside* a value — it ends the comment early and spills the remainder into the page as literal text.\n- **In a list, indent the directive inside the item**, with blank lines around it (below). At the start of a line between two items it ends the list and starts a second one, which changes the numbering and the spacing in every renderer — the one thing a directive must never do.\n- **An open question's id is `OQ-` then an optional short uppercase prefix then digits** — `OQ-9`, `OQ-TP6`, `OQ-A03`. The prefix is what keeps ids distinct once one document references another's questions, so use one in both whenever they cross-reference. `vantage-check` reports anything outside that shape as `vantage/oq-id-format`, and the same id twice in one document as `vantage/oq-id-duplicate` — both are silent otherwise, because the id becomes the block's anchor and a refused or duplicated one simply goes nowhere.\n- **A reference is a link, or it is a lie.** An `OQ-` id, a `§N` section number and a filename all read like pointers, and written as bare prose none of them can be followed or checked — which is exactly why a stale one is never caught. Link the question to its anchor (`[OQ-4](#OQ-4)`, or the Decision Ledger once it is compacted), the section to its heading, the filename to the file. `vantage-check` reports all three (`ref/*`) as errors, and checks that the link points at the thing the reference names rather than merely at something. Writing a specimen rather than a reference? Put it in a fenced block, which the rules never read.\n- **Every open question (💬) with a stated leaning gets an `oq` directive.** The convention's prose — the emoji, the `OQ-N` id, the `_Leaning:_` line, the fill-in `**Answer:**` — produces no button on its own. Writing the convention and stopping there is the most common way this feature goes missing: the questions look complete, review mode is on, and there is nothing to click. **`vantage-check` reports it as an error** (`vantage/oq-missing`), because a question awaiting a ruling that the reviewer cannot file is not a style preference. Mark it 🔒 if it is blocked on something upstream and cannot be answered yet, or ✅ once it is decided; either state needs no directive.\n- **A `leaning` restates the leaning; it is never \"yes\".** The one-click button in review mode files that text as a review comment, and the comment is all the agent reading it has — nobody remembers which button was clicked. `leaning=\"Yes\"` beside a two-branch question is a support ticket.\n\n```markdown\n1. **OQ-9: Queue position on re-entry.**\n\n <!-- vantage: oq id=OQ-9 leaning=\"Back of the queue — the fix might interact with what merged while it was out.\" -->\n\n _Leaning:_ Back of the queue.\n```\n\n### Tables, task lists, and math\n- **Tables**: Use standard markdown tables for structured comparisons and schemas.\n- **Task lists**: Use `- [ ]` and `- [x]` for actionable checklists and status tracking.\n- **LaTeX Math**: Use `$$...$$` for *all* KaTeX math — display blocks (`$$` alone on its own lines) and inline alike (`$$E = mc^2$$` mid-sentence).\n - Single dollars are **not** math delimiters: `$HOME` and `$100` stay literal, so prose and shell snippets are safe to write as-is.\n";
|
|
2484
|
+
export declare const STYLE_GUIDE = "## Markdown style guide (for Vantage viewer)\n\nWhen writing or updating markdown documents that will be viewed in Vantage, follow these conventions:\n\n### Structure\n- Use headings (## and ###) to organize content — they become navigable outline anchors.\n- Keep paragraphs focused and concise. Break up dense text with subheadings, lists, or tables.\n\n### Links and cross-references\n- **Relative paths only**: Always link relative to the *current file's directory*:\n - Sibling in same folder: `[Other Doc](./other-doc.md)` or `[Other Doc](other-doc.md)`\n - Subdirectory: `[Design Doc](./design/auth.md)`\n - Parent / sibling folder: `[Overview](../overview.md)` or `[Spec](../specs/api.md)`\n- **Never use leading slashes**:\n - ❌ `[Doc](/docs/guide.md)` (breaks web routing and multi-repo scoping)\n - ✅ `[Doc](../docs/guide.md)` or `[Doc](./guide.md)`\n- **Never use absolute filesystem paths or URI schemes**:\n - ❌ `file:///workspace/docs/guide.md`, `/workspace/docs/guide.md`, `C:\\...`\n - ✅ `[Doc](./guide.md)` or `[Doc](../guide.md)`\n- **Always include the file extension**: Use `.md`, `.ts`, `.go`, etc. (e.g. `[Model](model.go)`).\n- **Line anchors and ranges**:\n - Link to specific lines: `[Handler](../server/api.go#L42)` or `[Range](../server/api.go#L42-L58)`\n - Same-file line anchor: `[See lines](#L10-L25)`\n - Vantage scrolls to and highlights the target lines.\n- **Section anchors**:\n - Same doc: `[Usage](#usage)`\n - Cross-doc: `[Architecture](../overview.md#system-architecture)`\n - Anchor slugs are lowercase, hyphenated, and punctuation-stripped.\n- **Backticks in links**: Place backticks inside the link label, not around the markdown link syntax:\n - ✅ `[`config.json`](./config.json)` or `[config.json](./config.json)`\n - ❌ ``[config.json](./config.json)``\n\n### Frontmatter (Metadata)\n- Include structured metadata at the very top of docs delimited by `---` (YAML) or `+++` (TOML). Vantage renders this as a metadata card:\n```yaml\n---\ntitle: \"Feature Specification\"\nauthor: \"Agent\"\ndate: 2026-08-15\nstatus: in-review # draft | in-review | accepted | deprecated\ntags: [architecture, backend, api]\nsummary: \"Brief description of the document purpose.\"\nvantage:\n status-chip: true # show `status` as a chip above the metadata card\n---\n```\n- **Nothing may sit above the opening delimiter** — not a blank line, not an editorial comment, not a `<!-- vantage: … -->` directive. Frontmatter is recognised only at the very first byte of the file (in Vantage, on GitHub, and in every other reader), so one line above it turns the whole block into body text: a horizontal rule followed by a heading made of the raw keys, with every field lost. `vantage-check` reports it as `frontmatter/not-at-top`.\n- **`vantage:` is Vantage's own reserved key.** It holds chrome that belongs to the file rather than to a section, it never shows up in the metadata card, and every other renderer ignores it. One key today: `status-chip`.\n- **Prefer `status-chip: true`**, which shows the document's own `status:` and therefore cannot disagree with it. A literal `status-chip: accepted` is accepted too, but it is a second value that goes stale on its own — `vantage-check` reports the disagreement.\n- The chip's vocabulary is `status`'s, exactly: `draft | in-review | accepted | deprecated`, lowercase. `Draft` renders no chip at all, silently.\n\n### Mermaid diagrams\n- Use ```mermaid code blocks for flowcharts, sequence diagrams, and architecture diagrams. Vantage provides interactive zoom, pan, dark/light theme adaptation, and SVG export.\n- **Quote labels with special characters**: Always quote node labels containing parentheses, brackets, or colons to prevent syntax errors:\n```mermaid\nflowchart TD\n client[\"Client (React SPA)\"] -->|WebSocket| srv[\"Vantage Server (Go)\"]\n srv --> git[\"Git CLI (git diff)\"]\n```\n\n### Code blocks and diffs\n- Always tag fenced code blocks with language identifiers (`ts`, `go`, `python`, `bash`, `json`, `yaml`, `diff`, `sql`, etc.) for syntax highlighting.\n- For proposed code modifications, use ```diff blocks with `+` and `-` prefixes:\n```diff\n-const oldUrl = \"/api/v1\";\n+const newUrl = \"/api/v2\";\n```\n\n### Callouts and alerts\n- Use GitHub-style blockquote callouts for notes, tips, and warnings:\n> [!NOTE]\n> Background context or helpful explanation.\n\n> [!TIP]\n> Best practice advice or optimization suggestions.\n\n> [!IMPORTANT]\n> Key requirements or crucial information.\n\n> [!WARNING]\n> Urgent caution, breaking changes, or potential pitfalls.\n\n> [!CAUTION]\n> High-risk actions that could cause data loss or security issues.\n\n### Vantage directives (optional, and Vantage-only)\n\nVantage reads a few styling hints from ordinary HTML comments. Every other renderer — GitHub included — drops them, so a document has to read exactly the same without them: directives decorate, they never carry meaning. One goes on a line of its own, with a blank line after it, and applies to the block that follows:\n\n```markdown\n<!-- vantage: section tone=warning badge=stale -->\n\n## Migration path\n\nThe steps below predate the rewrite.\n```\n\n- **Three names**: `section` (the heading and everything under it), `block` (the one block after it), `oq` (one answerable Open Question).\n- **The keys and values are a closed set**: `tone` = `note | tip | important | warning | caution | muted`; `emphasis` = `strong | normal | quiet`; `badge` = `draft | stale | blocked | done | wip`; `collapsed` = `true | false`. Name a *tone*, never a colour — the theme decides what a warning looks like, in light mode, in dark mode, and in print.\n- **Use them sparingly.** One or two per document, on the sections that genuinely differ. A document where everything is toned says nothing, and a rainbow one is harder to read than a plain one.\n- **Anything outside those sets is silently ignored** — nothing breaks, and nothing styles either. Run `vantage-check` on the document: the `vantage/*` rules are the only thing that will ever tell you a directive did nothing.\n- **Always close the comment with `-->`.** Never `--!>`, and never leave it open: Markdown reads every line below an unclosed `<!--` as part of the comment, and the whole rest of the document vanishes from the page. For the same reason `-->` cannot appear *inside* a value — it ends the comment early and spills the remainder into the page as literal text.\n- **In a list, indent the directive inside the item**, with blank lines around it (below). At the start of a line between two items it ends the list and starts a second one, which changes the numbering and the spacing in every renderer — the one thing a directive must never do.\n- **An open question's id is `OQ-` then an optional short uppercase prefix then digits** — `OQ-9`, `OQ-TP6`, `OQ-A03`. The prefix is what keeps ids distinct once one document references another's questions, so use one in both whenever they cross-reference. `vantage-check` reports anything outside that shape as `vantage/oq-id-format`, and the same id twice in one document as `vantage/oq-id-duplicate` — both are silent otherwise, because the id becomes the block's anchor and a refused or duplicated one simply goes nowhere.\n- **A reference is a link, or it is a lie.** An `OQ-` id, a `§N` section number and a filename all read like pointers, and written as bare prose none of them can be followed or checked — which is exactly why a stale one is never caught. Link the question to its anchor (`[OQ-4](#OQ-4)`, or the Decision Ledger once it is compacted), the section to its heading, the filename to the file. `vantage-check` reports all three (`ref/*`) as errors, and checks that the link points at the thing the reference names rather than merely at something. Writing a specimen rather than a reference? Put it in a fenced block, which the rules never read.\n- **Every open question (💬) with a stated leaning gets an `oq` directive.** The convention's prose — the emoji, the `OQ-N` id, the `_Leaning:_` line, the fill-in `**Answer:**` — produces no button on its own. Writing the convention and stopping there is the most common way this feature goes missing: the questions look complete, review mode is on, and there is nothing to click. **`vantage-check` reports it as an error** (`vantage/oq-missing`), because a question awaiting a ruling that the reviewer cannot file is not a style preference. Mark it 🔒 if it is blocked on something upstream and cannot be answered yet, or ✅ once it is decided; either state needs no directive.\n- **A `leaning` restates the leaning; it is never \"yes\".** The one-click button in review mode files that text as a review comment, and the comment is all the agent reading it has — nobody remembers which button was clicked. `leaning=\"Yes\"` beside a two-branch question is a support ticket.\n\n```markdown\n1. **OQ-9: Queue position on re-entry.**\n\n <!-- vantage: oq id=OQ-9 leaning=\"Back of the queue — the fix might interact with what merged while it was out.\" -->\n\n _Leaning:_ Back of the queue.\n```\n\n### Tables, task lists, and math\n- **Tables**: Use standard markdown tables for structured comparisons and schemas.\n- **Task lists**: Use `- [ ]` and `- [x]` for actionable checklists and status tracking.\n- **LaTeX Math**: Use `$$...$$` for *all* KaTeX math — display blocks (`$$` alone on its own lines) and inline alike (`$$E = mc^2$$` mid-sentence).\n - Single dollars are **not** math delimiters: `$HOME` and `$100` stay literal, so prose and shell snippets are safe to write as-is.\n";
|
|
1520
2485
|
//#endregion
|
|
1521
|
-
export {
|
|
2486
|
+
export { type DirectivePair, type DirectiveParse, type DirectiveVocabulary, type DocStatus, type FrontmatterFormat, type FrontmatterProblem, type KeyTable, type KeyVocabulary, type MalformedDirective, type ParsedDirective, type ParsedFrontmatter, type Pipeline, type PipelineOptions, type RenderMermaidOptions, type RenderOptions, type RenderResult, type ResolveLinkOptions, type VantageAlert, type VantageFrontmatter, type VantageFrontmatterIssue, rehypeSourceLines, rehypeVantageAnchors, rehypeVantageDirectives };
|
|
1522
2487
|
//# sourceMappingURL=index.d.ts.map
|