vantage-md 0.5.4 → 0.5.6
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 +1397 -946
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1094 -220
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +1094 -220
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1361 -928
- package/dist/index.js.map +1 -1
- package/dist/prose.css +85 -33
- package/dist/react.cjs +2022 -1724
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1101 -214
- package/dist/react.d.cts.map +1 -0
- package/dist/react.d.ts +1101 -214
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +1985 -1706
- package/dist/react.js.map +1 -1
- package/dist/styles.css +15 -261
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { PluggableList, Plugin } from "unified";
|
|
2
|
+
import { defaultSchema } from "rehype-sanitize";
|
|
3
|
+
//#region src/renderMarkdown.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Framework-agnostic markdown -> HTML rendering pipeline.
|
|
7
6
|
* Uses the same remark/rehype chain as the Vantage viewer.
|
|
8
7
|
*/
|
|
9
8
|
interface RenderOptions {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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;
|
|
22
21
|
}
|
|
23
22
|
interface RenderResult {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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;
|
|
30
29
|
}
|
|
31
30
|
/**
|
|
32
31
|
* Render a markdown string to HTML using the full Vantage pipeline.
|
|
@@ -45,48 +44,971 @@ interface RenderResult {
|
|
|
45
44
|
* Use the React `<MarkdownViewer>` component for client-side mermaid rendering.
|
|
46
45
|
*/
|
|
47
46
|
declare function renderMarkdown(content: string, options?: RenderOptions): Promise<RenderResult>;
|
|
48
|
-
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region ../../node_modules/@types/unist/index.d.ts
|
|
49
|
+
// ## Interfaces
|
|
49
50
|
/**
|
|
50
|
-
*
|
|
51
|
-
* elements based on their position in the original markdown source.
|
|
51
|
+
* Info associated with nodes by the ecosystem.
|
|
52
52
|
*
|
|
53
|
-
* This
|
|
54
|
-
*
|
|
53
|
+
* This space is guaranteed to never be specified by unist or specifications
|
|
54
|
+
* implementing unist.
|
|
55
|
+
* But you can use it in utilities and plugins to store data.
|
|
56
|
+
*
|
|
57
|
+
* This type can be augmented to register custom data.
|
|
58
|
+
* For example:
|
|
59
|
+
*
|
|
60
|
+
* ```ts
|
|
61
|
+
* declare module 'unist' {
|
|
62
|
+
* interface Data {
|
|
63
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
64
|
+
* myId?: number | undefined
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
55
68
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
interface Data$1 {}
|
|
70
|
+
/**
|
|
71
|
+
* One place in a source file.
|
|
72
|
+
*/
|
|
73
|
+
interface Point {
|
|
74
|
+
/**
|
|
75
|
+
* Line in a source file (1-indexed integer).
|
|
76
|
+
*/
|
|
77
|
+
line: number;
|
|
78
|
+
/**
|
|
79
|
+
* Column in a source file (1-indexed integer).
|
|
80
|
+
*/
|
|
81
|
+
column: number;
|
|
82
|
+
/**
|
|
83
|
+
* Character in a source file (0-indexed integer).
|
|
84
|
+
*/
|
|
85
|
+
offset?: number | undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Position of a node in a source document.
|
|
89
|
+
*
|
|
90
|
+
* A position is a range between two points.
|
|
91
|
+
*/
|
|
92
|
+
interface Position {
|
|
93
|
+
/**
|
|
94
|
+
* Place of the first character of the parsed source region.
|
|
95
|
+
*/
|
|
96
|
+
start: Point;
|
|
97
|
+
/**
|
|
98
|
+
* Place of the first character after the parsed source region.
|
|
99
|
+
*/
|
|
100
|
+
end: Point;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Abstract unist node.
|
|
104
|
+
*
|
|
105
|
+
* The syntactic unit in unist syntax trees are called nodes.
|
|
106
|
+
*
|
|
107
|
+
* This interface is supposed to be extended.
|
|
108
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
109
|
+
* But for example in markdown, a `thematicBreak` (`***`), is neither literal
|
|
110
|
+
* nor parent, but still a node.
|
|
111
|
+
*/
|
|
112
|
+
interface Node$1 {
|
|
113
|
+
/**
|
|
114
|
+
* Node type.
|
|
115
|
+
*/
|
|
116
|
+
type: string;
|
|
117
|
+
/**
|
|
118
|
+
* Info from the ecosystem.
|
|
119
|
+
*/
|
|
120
|
+
data?: Data$1 | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Position of a node in a source document.
|
|
123
|
+
*
|
|
124
|
+
* Nodes that are generated (not in the original source document) must not
|
|
125
|
+
* have a position.
|
|
126
|
+
*/
|
|
127
|
+
position?: Position | undefined;
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region ../../node_modules/@types/hast/index.d.ts
|
|
131
|
+
// ## Interfaces
|
|
132
|
+
/**
|
|
133
|
+
* Info associated with hast nodes by the ecosystem.
|
|
134
|
+
*
|
|
135
|
+
* This space is guaranteed to never be specified by unist or hast.
|
|
136
|
+
* But you can use it in utilities and plugins to store data.
|
|
137
|
+
*
|
|
138
|
+
* This type can be augmented to register custom data.
|
|
139
|
+
* For example:
|
|
140
|
+
*
|
|
141
|
+
* ```ts
|
|
142
|
+
* declare module 'hast' {
|
|
143
|
+
* interface Data {
|
|
144
|
+
* // `someNode.data.myId` is typed as `number | undefined`
|
|
145
|
+
* myId?: number | undefined
|
|
146
|
+
* }
|
|
147
|
+
* }
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
interface Data extends Data$1 {}
|
|
151
|
+
/**
|
|
152
|
+
* Info associated with an element.
|
|
153
|
+
*/
|
|
154
|
+
interface Properties {
|
|
155
|
+
abbr?: string | undefined;
|
|
156
|
+
about?: Array<string> | undefined;
|
|
157
|
+
accentHeight?: number | string | undefined;
|
|
158
|
+
accept?: Array<string> | undefined;
|
|
159
|
+
acceptCharset?: Array<string> | undefined;
|
|
160
|
+
accessKey?: Array<string> | undefined;
|
|
161
|
+
accumulate?: string | undefined;
|
|
162
|
+
action?: string | undefined;
|
|
163
|
+
additive?: string | undefined;
|
|
164
|
+
align?: string | undefined;
|
|
165
|
+
alignmentBaseline?: string | undefined;
|
|
166
|
+
aLink?: string | undefined;
|
|
167
|
+
allow?: string | undefined;
|
|
168
|
+
allowFullScreen?: boolean | string | undefined;
|
|
169
|
+
allowPaymentRequest?: boolean | string | undefined;
|
|
170
|
+
allowTransparency?: string | undefined;
|
|
171
|
+
allowUserMedia?: boolean | string | undefined;
|
|
172
|
+
alpha?: boolean | string | undefined;
|
|
173
|
+
alphabetic?: number | string | undefined;
|
|
174
|
+
alt?: string | undefined;
|
|
175
|
+
amplitude?: number | string | undefined;
|
|
176
|
+
arabicForm?: string | undefined;
|
|
177
|
+
archive?: Array<string> | undefined;
|
|
178
|
+
ariaActiveDescendant?: string | undefined;
|
|
179
|
+
ariaAtomic?: "false" | "true" | (string & {}) | undefined;
|
|
180
|
+
ariaAutoComplete?: string | undefined;
|
|
181
|
+
ariaBusy?: "false" | "true" | (string & {}) | undefined;
|
|
182
|
+
ariaChecked?: "false" | "true" | (string & {}) | undefined;
|
|
183
|
+
ariaColCount?: number | string | undefined;
|
|
184
|
+
ariaColIndex?: number | string | undefined;
|
|
185
|
+
ariaColSpan?: number | string | undefined;
|
|
186
|
+
ariaControls?: Array<string> | undefined;
|
|
187
|
+
ariaCurrent?: string | undefined;
|
|
188
|
+
ariaDescribedBy?: Array<string> | undefined;
|
|
189
|
+
ariaDetails?: string | undefined;
|
|
190
|
+
ariaDisabled?: "false" | "true" | (string & {}) | undefined;
|
|
191
|
+
ariaDropEffect?: Array<string> | undefined;
|
|
192
|
+
ariaErrorMessage?: string | undefined;
|
|
193
|
+
ariaExpanded?: "false" | "true" | (string & {}) | undefined;
|
|
194
|
+
ariaFlowTo?: Array<string> | undefined;
|
|
195
|
+
ariaGrabbed?: "false" | "true" | (string & {}) | undefined;
|
|
196
|
+
ariaHasPopup?: string | undefined;
|
|
197
|
+
ariaHidden?: "false" | "true" | (string & {}) | undefined;
|
|
198
|
+
ariaInvalid?: string | undefined;
|
|
199
|
+
ariaKeyShortcuts?: string | undefined;
|
|
200
|
+
ariaLabel?: string | undefined;
|
|
201
|
+
ariaLabelledBy?: Array<string> | undefined;
|
|
202
|
+
ariaLevel?: number | string | undefined;
|
|
203
|
+
ariaLive?: string | undefined;
|
|
204
|
+
ariaModal?: "false" | "true" | (string & {}) | undefined;
|
|
205
|
+
ariaMultiLine?: "false" | "true" | (string & {}) | undefined;
|
|
206
|
+
ariaMultiSelectable?: "false" | "true" | (string & {}) | undefined;
|
|
207
|
+
ariaOrientation?: string | undefined;
|
|
208
|
+
ariaOwns?: Array<string> | undefined;
|
|
209
|
+
ariaPlaceholder?: string | undefined;
|
|
210
|
+
ariaPosInSet?: number | string | undefined;
|
|
211
|
+
ariaPressed?: "false" | "true" | (string & {}) | undefined;
|
|
212
|
+
ariaReadOnly?: "false" | "true" | (string & {}) | undefined;
|
|
213
|
+
ariaRelevant?: string | undefined;
|
|
214
|
+
ariaRequired?: "false" | "true" | (string & {}) | undefined;
|
|
215
|
+
ariaRoleDescription?: Array<string> | undefined;
|
|
216
|
+
ariaRowCount?: number | string | undefined;
|
|
217
|
+
ariaRowIndex?: number | string | undefined;
|
|
218
|
+
ariaRowSpan?: number | string | undefined;
|
|
219
|
+
ariaSelected?: "false" | "true" | (string & {}) | undefined;
|
|
220
|
+
ariaSetSize?: number | string | undefined;
|
|
221
|
+
ariaSort?: string | undefined;
|
|
222
|
+
ariaValueMax?: number | string | undefined;
|
|
223
|
+
ariaValueMin?: number | string | undefined;
|
|
224
|
+
ariaValueNow?: number | string | undefined;
|
|
225
|
+
ariaValueText?: string | undefined;
|
|
226
|
+
as?: string | undefined;
|
|
227
|
+
ascent?: number | string | undefined;
|
|
228
|
+
async?: boolean | string | undefined;
|
|
229
|
+
attributeName?: string | undefined;
|
|
230
|
+
attributeType?: string | undefined;
|
|
231
|
+
autoCapitalize?: string | undefined;
|
|
232
|
+
autoComplete?: Array<string> | undefined;
|
|
233
|
+
autoCorrect?: string | undefined;
|
|
234
|
+
autoFocus?: boolean | string | undefined;
|
|
235
|
+
autoPlay?: boolean | string | undefined;
|
|
236
|
+
autoSave?: string | undefined;
|
|
237
|
+
axis?: string | undefined;
|
|
238
|
+
azimuth?: number | string | undefined;
|
|
239
|
+
background?: string | undefined;
|
|
240
|
+
bandwidth?: string | undefined;
|
|
241
|
+
baseFrequency?: string | undefined;
|
|
242
|
+
baselineShift?: string | undefined;
|
|
243
|
+
baseProfile?: string | undefined;
|
|
244
|
+
bbox?: string | undefined;
|
|
245
|
+
begin?: string | undefined;
|
|
246
|
+
bgColor?: string | undefined;
|
|
247
|
+
bias?: number | string | undefined;
|
|
248
|
+
blocking?: Array<string> | undefined;
|
|
249
|
+
border?: number | string | undefined;
|
|
250
|
+
borderColor?: string | undefined;
|
|
251
|
+
bottomMargin?: number | string | undefined;
|
|
252
|
+
by?: string | undefined;
|
|
253
|
+
calcMode?: string | undefined;
|
|
254
|
+
capHeight?: number | string | undefined;
|
|
255
|
+
capture?: string | undefined;
|
|
256
|
+
cellPadding?: string | undefined;
|
|
257
|
+
cellSpacing?: string | undefined;
|
|
258
|
+
char?: string | undefined;
|
|
259
|
+
charOff?: string | undefined;
|
|
260
|
+
charSet?: string | undefined;
|
|
261
|
+
checked?: boolean | string | undefined;
|
|
262
|
+
cite?: string | undefined;
|
|
263
|
+
classId?: string | undefined;
|
|
264
|
+
className?: Array<string> | undefined;
|
|
265
|
+
clear?: string | undefined;
|
|
266
|
+
clip?: string | undefined;
|
|
267
|
+
clipPath?: string | undefined;
|
|
268
|
+
clipPathUnits?: string | undefined;
|
|
269
|
+
clipRule?: string | undefined;
|
|
270
|
+
closedBy?: string | undefined;
|
|
271
|
+
code?: string | undefined;
|
|
272
|
+
codeBase?: string | undefined;
|
|
273
|
+
codeType?: string | undefined;
|
|
274
|
+
color?: string | undefined;
|
|
275
|
+
colorInterpolation?: string | undefined;
|
|
276
|
+
colorInterpolationFilters?: string | undefined;
|
|
277
|
+
colorProfile?: string | undefined;
|
|
278
|
+
colorRendering?: string | undefined;
|
|
279
|
+
colorSpace?: string | undefined;
|
|
280
|
+
cols?: number | string | undefined;
|
|
281
|
+
colSpan?: number | string | undefined;
|
|
282
|
+
command?: string | undefined;
|
|
283
|
+
commandFor?: string | undefined;
|
|
284
|
+
compact?: boolean | string | undefined;
|
|
285
|
+
content?: string | undefined;
|
|
286
|
+
contentEditable?: "false" | "true" | (string & {}) | undefined;
|
|
287
|
+
contentScriptType?: string | undefined;
|
|
288
|
+
contentStyleType?: string | undefined;
|
|
289
|
+
controls?: boolean | string | undefined;
|
|
290
|
+
controlsList?: Array<string> | undefined;
|
|
291
|
+
coords?: Array<number | string> | undefined;
|
|
292
|
+
credentialless?: boolean | string | undefined;
|
|
293
|
+
crossOrigin?: string | undefined;
|
|
294
|
+
cursor?: string | undefined;
|
|
295
|
+
cx?: string | undefined;
|
|
296
|
+
cy?: string | undefined;
|
|
297
|
+
d?: string | undefined;
|
|
298
|
+
data?: string | undefined;
|
|
299
|
+
dataType?: string | undefined;
|
|
300
|
+
dateTime?: string | undefined;
|
|
301
|
+
declare?: boolean | string | undefined;
|
|
302
|
+
decoding?: string | undefined;
|
|
303
|
+
default?: boolean | string | undefined;
|
|
304
|
+
defaultAction?: string | undefined;
|
|
305
|
+
defer?: boolean | string | undefined;
|
|
306
|
+
descent?: number | string | undefined;
|
|
307
|
+
diffuseConstant?: number | string | undefined;
|
|
308
|
+
dir?: string | undefined;
|
|
309
|
+
direction?: string | undefined;
|
|
310
|
+
dirName?: string | undefined;
|
|
311
|
+
disabled?: boolean | string | undefined;
|
|
312
|
+
disablePictureInPicture?: boolean | string | undefined;
|
|
313
|
+
disableRemotePlayback?: boolean | string | undefined;
|
|
314
|
+
display?: string | undefined;
|
|
315
|
+
divisor?: number | string | undefined;
|
|
316
|
+
dominantBaseline?: string | undefined;
|
|
317
|
+
download?: boolean | string | undefined;
|
|
318
|
+
draggable?: "false" | "true" | (string & {}) | undefined;
|
|
319
|
+
dur?: string | undefined;
|
|
320
|
+
dx?: string | undefined;
|
|
321
|
+
dy?: string | undefined;
|
|
322
|
+
edgeMode?: string | undefined;
|
|
323
|
+
editable?: string | undefined;
|
|
324
|
+
elevation?: number | string | undefined;
|
|
325
|
+
enableBackground?: string | undefined;
|
|
326
|
+
encType?: string | undefined;
|
|
327
|
+
end?: string | undefined;
|
|
328
|
+
enterKeyHint?: string | undefined;
|
|
329
|
+
event?: string | undefined;
|
|
330
|
+
exponent?: number | string | undefined;
|
|
331
|
+
exportParts?: Array<string> | undefined;
|
|
332
|
+
externalResourcesRequired?: string | undefined;
|
|
333
|
+
face?: string | undefined;
|
|
334
|
+
fetchPriority?: string | undefined;
|
|
335
|
+
fill?: string | undefined;
|
|
336
|
+
fillOpacity?: number | string | undefined;
|
|
337
|
+
fillRule?: string | undefined;
|
|
338
|
+
filter?: string | undefined;
|
|
339
|
+
filterRes?: string | undefined;
|
|
340
|
+
filterUnits?: string | undefined;
|
|
341
|
+
floodColor?: string | undefined;
|
|
342
|
+
floodOpacity?: string | undefined;
|
|
343
|
+
focusable?: string | undefined;
|
|
344
|
+
focusHighlight?: string | undefined;
|
|
345
|
+
fontFamily?: string | undefined;
|
|
346
|
+
fontSize?: string | undefined;
|
|
347
|
+
fontSizeAdjust?: string | undefined;
|
|
348
|
+
fontStretch?: string | undefined;
|
|
349
|
+
fontStyle?: string | undefined;
|
|
350
|
+
fontVariant?: string | undefined;
|
|
351
|
+
fontWeight?: string | undefined;
|
|
352
|
+
form?: string | undefined;
|
|
353
|
+
formAction?: string | undefined;
|
|
354
|
+
format?: string | undefined;
|
|
355
|
+
formEncType?: string | undefined;
|
|
356
|
+
formMethod?: string | undefined;
|
|
357
|
+
formNoValidate?: boolean | string | undefined;
|
|
358
|
+
formTarget?: string | undefined;
|
|
359
|
+
fr?: string | undefined;
|
|
360
|
+
frame?: string | undefined;
|
|
361
|
+
frameBorder?: string | undefined;
|
|
362
|
+
from?: string | undefined;
|
|
363
|
+
fx?: string | undefined;
|
|
364
|
+
fy?: string | undefined;
|
|
365
|
+
g1?: Array<string> | undefined;
|
|
366
|
+
g2?: Array<string> | undefined;
|
|
367
|
+
glyphName?: Array<string> | undefined;
|
|
368
|
+
glyphOrientationHorizontal?: string | undefined;
|
|
369
|
+
glyphOrientationVertical?: string | undefined;
|
|
370
|
+
glyphRef?: string | undefined;
|
|
371
|
+
gradientTransform?: string | undefined;
|
|
372
|
+
gradientUnits?: string | undefined;
|
|
373
|
+
handler?: string | undefined;
|
|
374
|
+
hanging?: number | string | undefined;
|
|
375
|
+
hatchContentUnits?: string | undefined;
|
|
376
|
+
hatchUnits?: string | undefined;
|
|
377
|
+
headers?: Array<string> | undefined;
|
|
378
|
+
height?: number | string | undefined;
|
|
379
|
+
hidden?: boolean | string | undefined;
|
|
380
|
+
high?: number | string | undefined;
|
|
381
|
+
horizAdvX?: number | string | undefined;
|
|
382
|
+
horizOriginX?: number | string | undefined;
|
|
383
|
+
horizOriginY?: number | string | undefined;
|
|
384
|
+
href?: string | undefined;
|
|
385
|
+
hrefLang?: string | undefined;
|
|
386
|
+
hSpace?: number | string | undefined;
|
|
387
|
+
htmlFor?: Array<string> | undefined;
|
|
388
|
+
httpEquiv?: Array<string> | undefined;
|
|
389
|
+
id?: string | undefined;
|
|
390
|
+
ideographic?: number | string | undefined;
|
|
391
|
+
imageRendering?: string | undefined;
|
|
392
|
+
imageSizes?: string | undefined;
|
|
393
|
+
imageSrcSet?: string | undefined;
|
|
394
|
+
in?: string | undefined;
|
|
395
|
+
in2?: string | undefined;
|
|
396
|
+
inert?: boolean | string | undefined;
|
|
397
|
+
initialVisibility?: string | undefined;
|
|
398
|
+
inputMode?: string | undefined;
|
|
399
|
+
integrity?: string | undefined;
|
|
400
|
+
intercept?: number | string | undefined;
|
|
401
|
+
is?: string | undefined;
|
|
402
|
+
isMap?: boolean | string | undefined;
|
|
403
|
+
itemId?: string | undefined;
|
|
404
|
+
itemProp?: Array<string> | undefined;
|
|
405
|
+
itemRef?: Array<string> | undefined;
|
|
406
|
+
itemScope?: boolean | string | undefined;
|
|
407
|
+
itemType?: Array<string> | undefined;
|
|
408
|
+
k?: number | string | undefined;
|
|
409
|
+
k1?: number | string | undefined;
|
|
410
|
+
k2?: number | string | undefined;
|
|
411
|
+
k3?: number | string | undefined;
|
|
412
|
+
k4?: number | string | undefined;
|
|
413
|
+
kernelMatrix?: Array<string> | undefined;
|
|
414
|
+
kernelUnitLength?: string | undefined;
|
|
415
|
+
kerning?: string | undefined;
|
|
416
|
+
keyPoints?: string | undefined;
|
|
417
|
+
keySplines?: string | undefined;
|
|
418
|
+
keyTimes?: string | undefined;
|
|
419
|
+
kind?: string | undefined;
|
|
420
|
+
label?: string | undefined;
|
|
421
|
+
lang?: string | undefined;
|
|
422
|
+
language?: string | undefined;
|
|
423
|
+
leftMargin?: number | string | undefined;
|
|
424
|
+
lengthAdjust?: string | undefined;
|
|
425
|
+
letterSpacing?: string | undefined;
|
|
426
|
+
lightingColor?: string | undefined;
|
|
427
|
+
limitingConeAngle?: number | string | undefined;
|
|
428
|
+
link?: string | undefined;
|
|
429
|
+
list?: string | undefined;
|
|
430
|
+
loading?: string | undefined;
|
|
431
|
+
local?: string | undefined;
|
|
432
|
+
longDesc?: string | undefined;
|
|
433
|
+
loop?: boolean | string | undefined;
|
|
434
|
+
low?: number | string | undefined;
|
|
435
|
+
lowSrc?: string | undefined;
|
|
436
|
+
manifest?: string | undefined;
|
|
437
|
+
marginHeight?: number | string | undefined;
|
|
438
|
+
marginWidth?: number | string | undefined;
|
|
439
|
+
markerEnd?: string | undefined;
|
|
440
|
+
markerHeight?: string | undefined;
|
|
441
|
+
markerMid?: string | undefined;
|
|
442
|
+
markerStart?: string | undefined;
|
|
443
|
+
markerUnits?: string | undefined;
|
|
444
|
+
markerWidth?: string | undefined;
|
|
445
|
+
mask?: string | undefined;
|
|
446
|
+
maskContentUnits?: string | undefined;
|
|
447
|
+
maskType?: string | undefined;
|
|
448
|
+
maskUnits?: string | undefined;
|
|
449
|
+
mathematical?: string | undefined;
|
|
450
|
+
max?: string | undefined;
|
|
451
|
+
maxLength?: number | string | undefined;
|
|
452
|
+
media?: string | undefined;
|
|
453
|
+
mediaCharacterEncoding?: string | undefined;
|
|
454
|
+
mediaContentEncodings?: string | undefined;
|
|
455
|
+
mediaSize?: number | string | undefined;
|
|
456
|
+
mediaTime?: string | undefined;
|
|
457
|
+
method?: string | undefined;
|
|
458
|
+
min?: string | undefined;
|
|
459
|
+
minLength?: number | string | undefined;
|
|
460
|
+
mode?: string | undefined;
|
|
461
|
+
multiple?: boolean | string | undefined;
|
|
462
|
+
muted?: boolean | string | undefined;
|
|
463
|
+
name?: string | undefined;
|
|
464
|
+
navDown?: string | undefined;
|
|
465
|
+
navDownLeft?: string | undefined;
|
|
466
|
+
navDownRight?: string | undefined;
|
|
467
|
+
navLeft?: string | undefined;
|
|
468
|
+
navNext?: string | undefined;
|
|
469
|
+
navPrev?: string | undefined;
|
|
470
|
+
navRight?: string | undefined;
|
|
471
|
+
navUp?: string | undefined;
|
|
472
|
+
navUpLeft?: string | undefined;
|
|
473
|
+
navUpRight?: string | undefined;
|
|
474
|
+
noHref?: boolean | string | undefined;
|
|
475
|
+
noModule?: boolean | string | undefined;
|
|
476
|
+
nonce?: string | undefined;
|
|
477
|
+
noResize?: boolean | string | undefined;
|
|
478
|
+
noShade?: boolean | string | undefined;
|
|
479
|
+
noValidate?: boolean | string | undefined;
|
|
480
|
+
noWrap?: boolean | string | undefined;
|
|
481
|
+
numOctaves?: string | undefined;
|
|
482
|
+
object?: string | undefined;
|
|
483
|
+
observer?: string | undefined;
|
|
484
|
+
offset?: string | undefined;
|
|
485
|
+
onAbort?: string | undefined;
|
|
486
|
+
onActivate?: string | undefined;
|
|
487
|
+
onAfterPrint?: string | undefined;
|
|
488
|
+
onAuxClick?: string | undefined;
|
|
489
|
+
onBeforeMatch?: string | undefined;
|
|
490
|
+
onBeforePrint?: string | undefined;
|
|
491
|
+
onBeforeToggle?: string | undefined;
|
|
492
|
+
onBeforeUnload?: string | undefined;
|
|
493
|
+
onBegin?: string | undefined;
|
|
494
|
+
onBlur?: string | undefined;
|
|
495
|
+
onCancel?: string | undefined;
|
|
496
|
+
onCanPlay?: string | undefined;
|
|
497
|
+
onCanPlayThrough?: string | undefined;
|
|
498
|
+
onChange?: string | undefined;
|
|
499
|
+
onClick?: string | undefined;
|
|
500
|
+
onClose?: string | undefined;
|
|
501
|
+
onContextLost?: string | undefined;
|
|
502
|
+
onContextMenu?: string | undefined;
|
|
503
|
+
onContextRestored?: string | undefined;
|
|
504
|
+
onCopy?: string | undefined;
|
|
505
|
+
onCueChange?: string | undefined;
|
|
506
|
+
onCut?: string | undefined;
|
|
507
|
+
onDblClick?: string | undefined;
|
|
508
|
+
onDrag?: string | undefined;
|
|
509
|
+
onDragEnd?: string | undefined;
|
|
510
|
+
onDragEnter?: string | undefined;
|
|
511
|
+
onDragExit?: string | undefined;
|
|
512
|
+
onDragLeave?: string | undefined;
|
|
513
|
+
onDragOver?: string | undefined;
|
|
514
|
+
onDragStart?: string | undefined;
|
|
515
|
+
onDrop?: string | undefined;
|
|
516
|
+
onDurationChange?: string | undefined;
|
|
517
|
+
onEmptied?: string | undefined;
|
|
518
|
+
onEnd?: string | undefined;
|
|
519
|
+
onEnded?: string | undefined;
|
|
520
|
+
onError?: string | undefined;
|
|
521
|
+
onFocus?: string | undefined;
|
|
522
|
+
onFocusIn?: string | undefined;
|
|
523
|
+
onFocusOut?: string | undefined;
|
|
524
|
+
onFormData?: string | undefined;
|
|
525
|
+
onHashChange?: string | undefined;
|
|
526
|
+
onInput?: string | undefined;
|
|
527
|
+
onInvalid?: string | undefined;
|
|
528
|
+
onKeyDown?: string | undefined;
|
|
529
|
+
onKeyPress?: string | undefined;
|
|
530
|
+
onKeyUp?: string | undefined;
|
|
531
|
+
onLanguageChange?: string | undefined;
|
|
532
|
+
onLoad?: string | undefined;
|
|
533
|
+
onLoadedData?: string | undefined;
|
|
534
|
+
onLoadedMetadata?: string | undefined;
|
|
535
|
+
onLoadEnd?: string | undefined;
|
|
536
|
+
onLoadStart?: string | undefined;
|
|
537
|
+
onMessage?: string | undefined;
|
|
538
|
+
onMessageError?: string | undefined;
|
|
539
|
+
onMouseDown?: string | undefined;
|
|
540
|
+
onMouseEnter?: string | undefined;
|
|
541
|
+
onMouseLeave?: string | undefined;
|
|
542
|
+
onMouseMove?: string | undefined;
|
|
543
|
+
onMouseOut?: string | undefined;
|
|
544
|
+
onMouseOver?: string | undefined;
|
|
545
|
+
onMouseUp?: string | undefined;
|
|
546
|
+
onMouseWheel?: string | undefined;
|
|
547
|
+
onOffline?: string | undefined;
|
|
548
|
+
onOnline?: string | undefined;
|
|
549
|
+
onPageHide?: string | undefined;
|
|
550
|
+
onPageShow?: string | undefined;
|
|
551
|
+
onPaste?: string | undefined;
|
|
552
|
+
onPause?: string | undefined;
|
|
553
|
+
onPlay?: string | undefined;
|
|
554
|
+
onPlaying?: string | undefined;
|
|
555
|
+
onPopState?: string | undefined;
|
|
556
|
+
onProgress?: string | undefined;
|
|
557
|
+
onRateChange?: string | undefined;
|
|
558
|
+
onRejectionHandled?: string | undefined;
|
|
559
|
+
onRepeat?: string | undefined;
|
|
560
|
+
onReset?: string | undefined;
|
|
561
|
+
onResize?: string | undefined;
|
|
562
|
+
onScroll?: string | undefined;
|
|
563
|
+
onScrollEnd?: string | undefined;
|
|
564
|
+
onSecurityPolicyViolation?: string | undefined;
|
|
565
|
+
onSeeked?: string | undefined;
|
|
566
|
+
onSeeking?: string | undefined;
|
|
567
|
+
onSelect?: string | undefined;
|
|
568
|
+
onShow?: string | undefined;
|
|
569
|
+
onSlotChange?: string | undefined;
|
|
570
|
+
onStalled?: string | undefined;
|
|
571
|
+
onStorage?: string | undefined;
|
|
572
|
+
onSubmit?: string | undefined;
|
|
573
|
+
onSuspend?: string | undefined;
|
|
574
|
+
onTimeUpdate?: string | undefined;
|
|
575
|
+
onToggle?: string | undefined;
|
|
576
|
+
onUnhandledRejection?: string | undefined;
|
|
577
|
+
onUnload?: string | undefined;
|
|
578
|
+
onVolumeChange?: string | undefined;
|
|
579
|
+
onWaiting?: string | undefined;
|
|
580
|
+
onWheel?: string | undefined;
|
|
581
|
+
onZoom?: string | undefined;
|
|
582
|
+
opacity?: string | undefined;
|
|
583
|
+
open?: boolean | string | undefined;
|
|
584
|
+
operator?: string | undefined;
|
|
585
|
+
optimum?: number | string | undefined;
|
|
586
|
+
order?: string | undefined;
|
|
587
|
+
orient?: string | undefined;
|
|
588
|
+
orientation?: string | undefined;
|
|
589
|
+
origin?: string | undefined;
|
|
590
|
+
overflow?: string | undefined;
|
|
591
|
+
overlay?: string | undefined;
|
|
592
|
+
overlinePosition?: number | string | undefined;
|
|
593
|
+
overlineThickness?: number | string | undefined;
|
|
594
|
+
paintOrder?: string | undefined;
|
|
595
|
+
panose1?: string | undefined;
|
|
596
|
+
part?: Array<string> | undefined;
|
|
597
|
+
path?: string | undefined;
|
|
598
|
+
pathLength?: number | string | undefined;
|
|
599
|
+
pattern?: string | undefined;
|
|
600
|
+
patternContentUnits?: string | undefined;
|
|
601
|
+
patternTransform?: string | undefined;
|
|
602
|
+
patternUnits?: string | undefined;
|
|
603
|
+
phase?: string | undefined;
|
|
604
|
+
ping?: Array<string> | undefined;
|
|
605
|
+
pitch?: string | undefined;
|
|
606
|
+
placeholder?: string | undefined;
|
|
607
|
+
playbackOrder?: string | undefined;
|
|
608
|
+
playsInline?: boolean | string | undefined;
|
|
609
|
+
pointerEvents?: string | undefined;
|
|
610
|
+
points?: string | undefined;
|
|
611
|
+
pointsAtX?: number | string | undefined;
|
|
612
|
+
pointsAtY?: number | string | undefined;
|
|
613
|
+
pointsAtZ?: number | string | undefined;
|
|
614
|
+
popover?: string | undefined;
|
|
615
|
+
popoverTarget?: string | undefined;
|
|
616
|
+
popoverTargetAction?: string | undefined;
|
|
617
|
+
poster?: string | undefined;
|
|
618
|
+
prefix?: string | undefined;
|
|
619
|
+
preload?: string | undefined;
|
|
620
|
+
preserveAlpha?: string | undefined;
|
|
621
|
+
preserveAspectRatio?: string | undefined;
|
|
622
|
+
primitiveUnits?: string | undefined;
|
|
623
|
+
profile?: string | undefined;
|
|
624
|
+
prompt?: string | undefined;
|
|
625
|
+
propagate?: string | undefined;
|
|
626
|
+
property?: string | Array<string> | undefined;
|
|
627
|
+
r?: string | undefined;
|
|
628
|
+
radius?: string | undefined;
|
|
629
|
+
readOnly?: boolean | string | undefined;
|
|
630
|
+
referrerPolicy?: string | undefined;
|
|
631
|
+
refX?: string | undefined;
|
|
632
|
+
refY?: string | undefined;
|
|
633
|
+
rel?: Array<string> | undefined;
|
|
634
|
+
renderingIntent?: string | undefined;
|
|
635
|
+
repeatCount?: string | undefined;
|
|
636
|
+
repeatDur?: string | undefined;
|
|
637
|
+
required?: boolean | string | undefined;
|
|
638
|
+
requiredExtensions?: Array<string> | undefined;
|
|
639
|
+
requiredFeatures?: Array<string> | undefined;
|
|
640
|
+
requiredFonts?: Array<string> | undefined;
|
|
641
|
+
requiredFormats?: Array<string> | undefined;
|
|
642
|
+
resource?: string | undefined;
|
|
643
|
+
restart?: string | undefined;
|
|
644
|
+
result?: string | undefined;
|
|
645
|
+
results?: number | string | undefined;
|
|
646
|
+
rev?: string | Array<string> | undefined;
|
|
647
|
+
reversed?: boolean | string | undefined;
|
|
648
|
+
rightMargin?: number | string | undefined;
|
|
649
|
+
role?: string | undefined;
|
|
650
|
+
rotate?: string | undefined;
|
|
651
|
+
rows?: number | string | undefined;
|
|
652
|
+
rowSpan?: number | string | undefined;
|
|
653
|
+
rules?: string | undefined;
|
|
654
|
+
rx?: string | undefined;
|
|
655
|
+
ry?: string | undefined;
|
|
656
|
+
sandbox?: Array<string> | undefined;
|
|
657
|
+
scale?: string | undefined;
|
|
658
|
+
scheme?: string | undefined;
|
|
659
|
+
scope?: string | undefined;
|
|
660
|
+
scoped?: boolean | string | undefined;
|
|
661
|
+
scrolling?: "false" | "true" | (string & {}) | undefined;
|
|
662
|
+
seamless?: boolean | string | undefined;
|
|
663
|
+
security?: string | undefined;
|
|
664
|
+
seed?: string | undefined;
|
|
665
|
+
selected?: boolean | string | undefined;
|
|
666
|
+
shadowRootClonable?: boolean | string | undefined;
|
|
667
|
+
shadowRootCustomElementRegistry?: boolean | string | undefined;
|
|
668
|
+
shadowRootDelegatesFocus?: boolean | string | undefined;
|
|
669
|
+
shadowRootMode?: string | undefined;
|
|
670
|
+
shadowRootSerializable?: boolean | string | undefined;
|
|
671
|
+
shape?: string | undefined;
|
|
672
|
+
shapeRendering?: string | undefined;
|
|
673
|
+
side?: string | undefined;
|
|
674
|
+
size?: number | string | undefined;
|
|
675
|
+
sizes?: string | undefined;
|
|
676
|
+
slope?: string | undefined;
|
|
677
|
+
slot?: string | undefined;
|
|
678
|
+
snapshotTime?: string | undefined;
|
|
679
|
+
spacing?: string | undefined;
|
|
680
|
+
span?: number | string | undefined;
|
|
681
|
+
specularConstant?: number | string | undefined;
|
|
682
|
+
specularExponent?: number | string | undefined;
|
|
683
|
+
spellCheck?: "false" | "true" | (string & {}) | undefined;
|
|
684
|
+
spreadMethod?: string | undefined;
|
|
685
|
+
src?: string | undefined;
|
|
686
|
+
srcDoc?: string | undefined;
|
|
687
|
+
srcLang?: string | undefined;
|
|
688
|
+
srcSet?: string | undefined;
|
|
689
|
+
standby?: string | undefined;
|
|
690
|
+
start?: number | string | undefined;
|
|
691
|
+
startOffset?: string | undefined;
|
|
692
|
+
stdDeviation?: string | undefined;
|
|
693
|
+
stemh?: string | undefined;
|
|
694
|
+
stemv?: string | undefined;
|
|
695
|
+
step?: string | undefined;
|
|
696
|
+
stitchTiles?: string | undefined;
|
|
697
|
+
stopColor?: string | undefined;
|
|
698
|
+
stopOpacity?: string | undefined;
|
|
699
|
+
strikethroughPosition?: number | string | undefined;
|
|
700
|
+
strikethroughThickness?: number | string | undefined;
|
|
701
|
+
string?: string | undefined;
|
|
702
|
+
stroke?: string | undefined;
|
|
703
|
+
strokeDashArray?: Array<string> | undefined;
|
|
704
|
+
strokeDashOffset?: string | undefined;
|
|
705
|
+
strokeLineCap?: string | undefined;
|
|
706
|
+
strokeLineJoin?: string | undefined;
|
|
707
|
+
strokeMiterLimit?: number | string | undefined;
|
|
708
|
+
strokeOpacity?: number | string | undefined;
|
|
709
|
+
strokeWidth?: string | undefined;
|
|
710
|
+
style?: string | undefined;
|
|
711
|
+
summary?: string | undefined;
|
|
712
|
+
surfaceScale?: number | string | undefined;
|
|
713
|
+
syncBehavior?: string | undefined;
|
|
714
|
+
syncBehaviorDefault?: string | undefined;
|
|
715
|
+
syncMaster?: string | undefined;
|
|
716
|
+
syncTolerance?: string | undefined;
|
|
717
|
+
syncToleranceDefault?: string | undefined;
|
|
718
|
+
systemLanguage?: Array<string> | undefined;
|
|
719
|
+
tabIndex?: number | string | undefined;
|
|
720
|
+
tableValues?: string | undefined;
|
|
721
|
+
target?: string | undefined;
|
|
722
|
+
targetX?: number | string | undefined;
|
|
723
|
+
targetY?: number | string | undefined;
|
|
724
|
+
text?: string | undefined;
|
|
725
|
+
textAnchor?: string | undefined;
|
|
726
|
+
textDecoration?: string | undefined;
|
|
727
|
+
textLength?: string | undefined;
|
|
728
|
+
textRendering?: string | undefined;
|
|
729
|
+
timelineBegin?: string | undefined;
|
|
730
|
+
title?: string | undefined;
|
|
731
|
+
to?: string | undefined;
|
|
732
|
+
topMargin?: number | string | undefined;
|
|
733
|
+
transform?: string | undefined;
|
|
734
|
+
transformBehavior?: string | undefined;
|
|
735
|
+
transformOrigin?: string | undefined;
|
|
736
|
+
translate?: string | undefined;
|
|
737
|
+
type?: string | undefined;
|
|
738
|
+
typeMustMatch?: boolean | string | undefined;
|
|
739
|
+
typeOf?: Array<string> | undefined;
|
|
740
|
+
u1?: string | undefined;
|
|
741
|
+
u2?: string | undefined;
|
|
742
|
+
underlinePosition?: number | string | undefined;
|
|
743
|
+
underlineThickness?: number | string | undefined;
|
|
744
|
+
unicode?: string | undefined;
|
|
745
|
+
unicodeBidi?: string | undefined;
|
|
746
|
+
unicodeRange?: string | undefined;
|
|
747
|
+
unitsPerEm?: number | string | undefined;
|
|
748
|
+
unselectable?: string | undefined;
|
|
749
|
+
useMap?: string | undefined;
|
|
750
|
+
vAlign?: string | undefined;
|
|
751
|
+
vAlphabetic?: number | string | undefined;
|
|
752
|
+
value?: "false" | "true" | (string & {}) | undefined;
|
|
753
|
+
values?: string | undefined;
|
|
754
|
+
valueType?: string | undefined;
|
|
755
|
+
vectorEffect?: string | undefined;
|
|
756
|
+
version?: string | undefined;
|
|
757
|
+
vertAdvY?: number | string | undefined;
|
|
758
|
+
vertOriginX?: number | string | undefined;
|
|
759
|
+
vertOriginY?: number | string | undefined;
|
|
760
|
+
vHanging?: number | string | undefined;
|
|
761
|
+
vIdeographic?: number | string | undefined;
|
|
762
|
+
viewBox?: string | undefined;
|
|
763
|
+
viewTarget?: string | undefined;
|
|
764
|
+
visibility?: string | undefined;
|
|
765
|
+
vLink?: string | undefined;
|
|
766
|
+
vMathematical?: number | string | undefined;
|
|
767
|
+
vSpace?: number | string | undefined;
|
|
768
|
+
width?: number | string | undefined;
|
|
769
|
+
widths?: string | undefined;
|
|
770
|
+
wordSpacing?: string | undefined;
|
|
771
|
+
wrap?: string | undefined;
|
|
772
|
+
writingMode?: string | undefined;
|
|
773
|
+
writingSuggestions?: string | undefined;
|
|
774
|
+
x?: string | undefined;
|
|
775
|
+
x1?: string | undefined;
|
|
776
|
+
x2?: string | undefined;
|
|
777
|
+
xChannelSelector?: string | undefined;
|
|
778
|
+
xHeight?: number | string | undefined;
|
|
779
|
+
xLinkActuate?: string | undefined;
|
|
780
|
+
xLinkArcRole?: string | undefined;
|
|
781
|
+
xLinkHref?: string | undefined;
|
|
782
|
+
xLinkRole?: string | undefined;
|
|
783
|
+
xLinkShow?: string | undefined;
|
|
784
|
+
xLinkTitle?: string | undefined;
|
|
785
|
+
xLinkType?: string | undefined;
|
|
786
|
+
xmlBase?: string | undefined;
|
|
787
|
+
xmlLang?: string | undefined;
|
|
788
|
+
xmlns?: string | undefined;
|
|
789
|
+
xmlnsXLink?: string | undefined;
|
|
790
|
+
xmlSpace?: string | undefined;
|
|
791
|
+
y?: string | undefined;
|
|
792
|
+
y1?: string | undefined;
|
|
793
|
+
y2?: string | undefined;
|
|
794
|
+
yChannelSelector?: string | undefined;
|
|
795
|
+
z?: string | undefined;
|
|
796
|
+
zoomAndPan?: string | undefined;
|
|
797
|
+
[PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
|
|
798
|
+
}
|
|
799
|
+
// ## Content maps
|
|
800
|
+
/**
|
|
801
|
+
* Union of registered hast nodes that can occur in {@link Element}.
|
|
802
|
+
*
|
|
803
|
+
* To register mote custom hast nodes, add them to {@link ElementContentMap}.
|
|
804
|
+
* They will be automatically added here.
|
|
805
|
+
*/
|
|
806
|
+
type ElementContent = ElementContentMap[keyof ElementContentMap];
|
|
807
|
+
/**
|
|
808
|
+
* Registry of all hast nodes that can occur as children of {@link Element}.
|
|
809
|
+
*
|
|
810
|
+
* For a union of all {@link Element} children, see {@link ElementContent}.
|
|
811
|
+
*/
|
|
812
|
+
interface ElementContentMap {
|
|
813
|
+
comment: Comment;
|
|
814
|
+
element: Element;
|
|
815
|
+
text: Text;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Union of registered hast nodes that can occur in {@link Root}.
|
|
819
|
+
*
|
|
820
|
+
* To register custom hast nodes, add them to {@link RootContentMap}.
|
|
821
|
+
* They will be automatically added here.
|
|
822
|
+
*/
|
|
823
|
+
type RootContent = RootContentMap[keyof RootContentMap];
|
|
824
|
+
/**
|
|
825
|
+
* Registry of all hast nodes that can occur as children of {@link Root}.
|
|
826
|
+
*
|
|
827
|
+
* > 👉 **Note**: {@link Root} does not need to be an entire document.
|
|
828
|
+
* > it can also be a fragment.
|
|
829
|
+
*
|
|
830
|
+
* For a union of all {@link Root} children, see {@link RootContent}.
|
|
831
|
+
*/
|
|
832
|
+
interface RootContentMap {
|
|
833
|
+
comment: Comment;
|
|
834
|
+
doctype: Doctype;
|
|
835
|
+
element: Element;
|
|
836
|
+
text: Text;
|
|
837
|
+
}
|
|
838
|
+
// ## Abstract nodes
|
|
839
|
+
/**
|
|
840
|
+
* Abstract hast node.
|
|
841
|
+
*
|
|
842
|
+
* This interface is supposed to be extended.
|
|
843
|
+
* If you can use {@link Literal} or {@link Parent}, you should.
|
|
844
|
+
* But for example in HTML, a `Doctype` is neither literal nor parent, but
|
|
845
|
+
* still a node.
|
|
846
|
+
*
|
|
847
|
+
* To register custom hast nodes, add them to {@link RootContentMap} and other
|
|
848
|
+
* places where relevant (such as {@link ElementContentMap}).
|
|
849
|
+
*
|
|
850
|
+
* For a union of all registered hast nodes, see {@link Nodes}.
|
|
851
|
+
*/
|
|
852
|
+
interface Node extends Node$1 {
|
|
853
|
+
/**
|
|
854
|
+
* Info from the ecosystem.
|
|
855
|
+
*/
|
|
856
|
+
data?: Data | undefined;
|
|
65
857
|
}
|
|
66
|
-
declare const rehypeSourceLines: Plugin<[RehypeSourceLinesOptions?], Root>;
|
|
67
|
-
|
|
68
858
|
/**
|
|
69
|
-
*
|
|
70
|
-
* `data-vantage-*` attributes on the block that follows them.
|
|
859
|
+
* Abstract hast node that contains the smallest possible value.
|
|
71
860
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
|
|
861
|
+
* This interface is supposed to be extended if you make custom hast nodes.
|
|
862
|
+
*
|
|
863
|
+
* For a union of all registered hast literals, see {@link Literals}.
|
|
864
|
+
*/
|
|
865
|
+
interface Literal extends Node {
|
|
866
|
+
/**
|
|
867
|
+
* Plain-text value.
|
|
868
|
+
*/
|
|
869
|
+
value: string;
|
|
870
|
+
}
|
|
871
|
+
/**
|
|
872
|
+
* Abstract hast node that contains other hast nodes (*children*).
|
|
76
873
|
*
|
|
77
|
-
*
|
|
78
|
-
* CLI checker imports too: one parser, two callers, so a directive cannot mean
|
|
79
|
-
* one thing in the viewer and another in the tool that validates it (D5).
|
|
874
|
+
* This interface is supposed to be extended if you make custom hast nodes.
|
|
80
875
|
*
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
876
|
+
* For a union of all registered hast parents, see {@link Parents}.
|
|
877
|
+
*/
|
|
878
|
+
interface Parent extends Node {
|
|
879
|
+
/**
|
|
880
|
+
* List of children.
|
|
881
|
+
*/
|
|
882
|
+
children: RootContent[];
|
|
883
|
+
}
|
|
884
|
+
// ## Concrete nodes
|
|
885
|
+
/**
|
|
886
|
+
* HTML comment.
|
|
887
|
+
*/
|
|
888
|
+
interface Comment extends Literal {
|
|
889
|
+
/**
|
|
890
|
+
* Node type of HTML comments in hast.
|
|
891
|
+
*/
|
|
892
|
+
type: "comment";
|
|
893
|
+
/**
|
|
894
|
+
* Data associated with the comment.
|
|
895
|
+
*/
|
|
896
|
+
data?: CommentData | undefined;
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* Info associated with hast comments by the ecosystem.
|
|
900
|
+
*/
|
|
901
|
+
interface CommentData extends Data {}
|
|
902
|
+
/**
|
|
903
|
+
* HTML document type.
|
|
904
|
+
*/
|
|
905
|
+
interface Doctype extends Node$1 {
|
|
906
|
+
/**
|
|
907
|
+
* Node type of HTML document types in hast.
|
|
908
|
+
*/
|
|
909
|
+
type: "doctype";
|
|
910
|
+
/**
|
|
911
|
+
* Data associated with the doctype.
|
|
912
|
+
*/
|
|
913
|
+
data?: DoctypeData | undefined;
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Info associated with hast doctypes by the ecosystem.
|
|
917
|
+
*/
|
|
918
|
+
interface DoctypeData extends Data {}
|
|
919
|
+
/**
|
|
920
|
+
* HTML element.
|
|
921
|
+
*/
|
|
922
|
+
interface Element extends Parent {
|
|
923
|
+
/**
|
|
924
|
+
* Node type of elements.
|
|
925
|
+
*/
|
|
926
|
+
type: "element";
|
|
927
|
+
/**
|
|
928
|
+
* Tag name (such as `'body'`) of the element.
|
|
929
|
+
*/
|
|
930
|
+
tagName: string;
|
|
931
|
+
/**
|
|
932
|
+
* Info associated with the element.
|
|
933
|
+
*/
|
|
934
|
+
properties: Properties;
|
|
935
|
+
/**
|
|
936
|
+
* Children of element.
|
|
937
|
+
*/
|
|
938
|
+
children: ElementContent[];
|
|
939
|
+
/**
|
|
940
|
+
* When the `tagName` field is `'template'`, a `content` field can be
|
|
941
|
+
* present.
|
|
942
|
+
*/
|
|
943
|
+
content?: Root | undefined;
|
|
944
|
+
/**
|
|
945
|
+
* Data associated with the element.
|
|
946
|
+
*/
|
|
947
|
+
data?: ElementData | undefined;
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Info associated with hast elements by the ecosystem.
|
|
86
951
|
*/
|
|
87
|
-
|
|
952
|
+
interface ElementData extends Data {}
|
|
953
|
+
/**
|
|
954
|
+
* Document fragment or a whole document.
|
|
955
|
+
*
|
|
956
|
+
* Should be used as the root of a tree and must not be used as a child.
|
|
957
|
+
*
|
|
958
|
+
* Can also be used as the value for the content field on a `'template'` element.
|
|
959
|
+
*/
|
|
960
|
+
interface Root extends Parent {
|
|
961
|
+
/**
|
|
962
|
+
* Node type of hast root.
|
|
963
|
+
*/
|
|
964
|
+
type: "root";
|
|
965
|
+
/**
|
|
966
|
+
* Children of root.
|
|
967
|
+
*/
|
|
968
|
+
children: RootContent[];
|
|
969
|
+
/**
|
|
970
|
+
* Data associated with the hast root.
|
|
971
|
+
*/
|
|
972
|
+
data?: RootData | undefined;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Info associated with hast root nodes by the ecosystem.
|
|
976
|
+
*/
|
|
977
|
+
interface RootData extends Data {}
|
|
978
|
+
/**
|
|
979
|
+
* HTML character data (plain text).
|
|
980
|
+
*/
|
|
981
|
+
interface Text extends Literal {
|
|
982
|
+
/**
|
|
983
|
+
* Node type of HTML character data (plain text) in hast.
|
|
984
|
+
*/
|
|
985
|
+
type: "text";
|
|
986
|
+
/**
|
|
987
|
+
* Data associated with the text.
|
|
988
|
+
*/
|
|
989
|
+
data?: TextData | undefined;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Info associated with hast texts by the ecosystem.
|
|
993
|
+
*/
|
|
994
|
+
interface TextData extends Data {}
|
|
995
|
+
//#endregion
|
|
996
|
+
//#region src/rehypeSourceLines.d.ts
|
|
997
|
+
interface RehypeSourceLinesOptions {
|
|
998
|
+
/**
|
|
999
|
+
* Lines stripped off the front of the file before parsing — frontmatter,
|
|
1000
|
+
* essentially. Added to every emitted line number so `data-source-line`
|
|
1001
|
+
* names a line in the *file* rather than in the parsed body, which is what
|
|
1002
|
+
* a `#L42` link written against the file means. Defaults to 0.
|
|
1003
|
+
*/
|
|
1004
|
+
offset?: number;
|
|
1005
|
+
}
|
|
1006
|
+
declare const rehypeSourceLines: Plugin<[RehypeSourceLinesOptions?], Root>;
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region src/rehypeVantageDirectives.d.ts
|
|
88
1009
|
declare const rehypeVantageDirectives: Plugin<[], Root>;
|
|
89
|
-
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region src/vantageDirectives.d.ts
|
|
90
1012
|
/**
|
|
91
1013
|
* The directive grammar and the closed vocabulary — one parser, no renderer.
|
|
92
1014
|
*
|
|
@@ -196,31 +1118,31 @@ type DirectiveVocabulary = Readonly<Record<string, KeyTable | undefined>>;
|
|
|
196
1118
|
*/
|
|
197
1119
|
declare const DIRECTIVE_VOCABULARY: DirectiveVocabulary;
|
|
198
1120
|
interface DirectivePair {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
1121
|
+
key: string;
|
|
1122
|
+
/** The value with quotes stripped, if it was quoted. */
|
|
1123
|
+
value: string;
|
|
1124
|
+
/** Offset of `key` within the comment's inner text. */
|
|
1125
|
+
keyOffset: number;
|
|
1126
|
+
/** Offset of the value token — opening quote included — within it. */
|
|
1127
|
+
valueOffset: number;
|
|
1128
|
+
quoted: boolean;
|
|
207
1129
|
}
|
|
208
1130
|
interface ParsedDirective {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
1131
|
+
kind: "directive";
|
|
1132
|
+
name: string;
|
|
1133
|
+
/** Offset of `name` within the comment's inner text. */
|
|
1134
|
+
nameOffset: number;
|
|
1135
|
+
/** In written order, duplicates included: a checker reports them, the
|
|
1136
|
+
* renderer resolves them last-one-wins. */
|
|
1137
|
+
pairs: DirectivePair[];
|
|
216
1138
|
}
|
|
217
1139
|
/** Sentinel present, grammar not satisfied. The renderer ignores `reason`. */
|
|
218
1140
|
interface MalformedDirective {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
1141
|
+
kind: "malformed";
|
|
1142
|
+
/** One clause a checker can quote verbatim, lowercase and unpunctuated. */
|
|
1143
|
+
reason: string;
|
|
1144
|
+
/** Offset of the first character the parse could not use. */
|
|
1145
|
+
offset: number;
|
|
224
1146
|
}
|
|
225
1147
|
type DirectiveParse = ParsedDirective | MalformedDirective | null;
|
|
226
1148
|
/**
|
|
@@ -240,60 +1162,30 @@ declare function hasVantageSentinel(comment: string): boolean;
|
|
|
240
1162
|
* point at the character that broke.
|
|
241
1163
|
*/
|
|
242
1164
|
declare function parseVantageDirective(comment: string): DirectiveParse;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
* The one definition of the Vantage remark/rehype chain.
|
|
246
|
-
*
|
|
247
|
-
* Three call sites render Markdown — `renderMarkdown` (string in, HTML out,
|
|
248
|
-
* which is what the CLI checker runs), the app's `<MarkdownViewer>`, and this
|
|
249
|
-
* package's exported `<MarkdownViewer>` — and each one used to hand-write the
|
|
250
|
-
* same plugin list in the same order. Three copies kept in sync by hand is how
|
|
251
|
-
* a plugin lands in the viewer and not in the checker: a document that styles
|
|
252
|
-
* in the app and renders bare through the tool that is supposed to validate it,
|
|
253
|
-
* with no error anywhere.
|
|
254
|
-
*
|
|
255
|
-
* The order is load-bearing, not incidental:
|
|
256
|
-
*
|
|
257
|
-
* - `rehypeRaw` first: `remark-rehype` runs with `allowDangerousHtml: true`,
|
|
258
|
-
* so raw HTML is still a string until this plugin parses it.
|
|
259
|
-
* - `rehypeSourceLines` before `rehypeSanitize`: `data-source-line` has to be
|
|
260
|
-
* an allowlisted attribute on an element the sanitiser keeps.
|
|
261
|
-
* - `rehypeSlug`, `rehypeHighlight` and `rehypeKatex` after `rehypeSanitize`.
|
|
262
|
-
* For `rehypeSlug` this is not a preference: the sanitiser's default schema
|
|
263
|
-
* clobbers `id` with the prefix `user-content-`, so slugging before it turns
|
|
264
|
-
* every `#heading` link in every document into a dead anchor. For the other
|
|
265
|
-
* two it means their output is trusted rather than filtered — KaTeX emits
|
|
266
|
-
* inline `style` on nearly every glyph.
|
|
267
|
-
*
|
|
268
|
-
* Anything that reads HTML comments must sit between `rehypeRaw` and
|
|
269
|
-
* `rehypeSanitize`: before `rehypeRaw` there are no comment nodes, and
|
|
270
|
-
* `rehypeSanitize` deletes them. `rehypeVantageDirectives` is what occupies
|
|
271
|
-
* that slot, and it is registered unconditionally — a renderer that skipped it
|
|
272
|
-
* would disagree with the others about what a document means.
|
|
273
|
-
*/
|
|
274
|
-
|
|
1165
|
+
//#endregion
|
|
1166
|
+
//#region src/pipeline.d.ts
|
|
275
1167
|
interface PipelineOptions {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
1168
|
+
/** GFM tables, strikethrough, task lists (default: true) */
|
|
1169
|
+
gfm?: boolean;
|
|
1170
|
+
/** KaTeX math, `$$…$$` only (default: true) */
|
|
1171
|
+
math?: boolean;
|
|
1172
|
+
/** Syntax highlighting via highlight.js (default: true) */
|
|
1173
|
+
highlight?: boolean;
|
|
1174
|
+
/** `data-source-line` attributes for line anchors (default: true) */
|
|
1175
|
+
sourceLines?: boolean;
|
|
1176
|
+
/** XSS sanitisation (default: true) */
|
|
1177
|
+
sanitize?: boolean;
|
|
1178
|
+
/**
|
|
1179
|
+
* Lines the frontmatter consumed, added to every emitted line number so
|
|
1180
|
+
* `data-source-line` names a line in the *file* rather than in the parsed
|
|
1181
|
+
* body — which is what a `#L42` link written against the file means.
|
|
1182
|
+
* Defaults to 0. Ignored when `sourceLines` is false.
|
|
1183
|
+
*/
|
|
1184
|
+
bodyLineOffset?: number;
|
|
293
1185
|
}
|
|
294
1186
|
interface Pipeline {
|
|
295
|
-
|
|
296
|
-
|
|
1187
|
+
remarkPlugins: PluggableList;
|
|
1188
|
+
rehypePlugins: PluggableList;
|
|
297
1189
|
}
|
|
298
1190
|
/**
|
|
299
1191
|
* The mdast half of the chain. Exported on its own because there is a real
|
|
@@ -315,7 +1207,8 @@ declare function buildRemarkPlugins(options?: PipelineOptions): PluggableList;
|
|
|
315
1207
|
* the chain has been built.
|
|
316
1208
|
*/
|
|
317
1209
|
declare function buildPipeline(options?: PipelineOptions): Pipeline;
|
|
318
|
-
|
|
1210
|
+
//#endregion
|
|
1211
|
+
//#region src/scrollToLineAnchor.d.ts
|
|
319
1212
|
/**
|
|
320
1213
|
* Framework-agnostic line anchor utilities.
|
|
321
1214
|
* Scroll to and highlight the elements a GitHub-style line anchor
|
|
@@ -334,7 +1227,8 @@ declare function clearLineAnchorHighlights(container: HTMLElement): void;
|
|
|
334
1227
|
* @returns A cleanup function that removes the highlights
|
|
335
1228
|
*/
|
|
336
1229
|
declare function scrollToLineAnchor(container: HTMLElement, hash: string): (() => void) | null;
|
|
337
|
-
|
|
1230
|
+
//#endregion
|
|
1231
|
+
//#region src/lineAnchor.d.ts
|
|
338
1232
|
/**
|
|
339
1233
|
* Parsing for GitHub-style line anchors, with no DOM in sight.
|
|
340
1234
|
*
|
|
@@ -349,10 +1243,11 @@ declare function scrollToLineAnchor(container: HTMLElement, hash: string): (() =
|
|
|
349
1243
|
* Returns null if the hash is not a line anchor.
|
|
350
1244
|
*/
|
|
351
1245
|
declare function parseLineAnchor(hash: string): {
|
|
352
|
-
|
|
353
|
-
|
|
1246
|
+
start: number;
|
|
1247
|
+
end: number;
|
|
354
1248
|
} | null;
|
|
355
|
-
|
|
1249
|
+
//#endregion
|
|
1250
|
+
//#region src/frontmatter.d.ts
|
|
356
1251
|
/**
|
|
357
1252
|
* Frontmatter parser for YAML (---) and TOML (+++) delimited content.
|
|
358
1253
|
* Works in both browser and server environments.
|
|
@@ -374,61 +1269,41 @@ type FrontmatterFormat = "yaml" | "toml" | "none";
|
|
|
374
1269
|
* of fields, which is not something a metadata card can render.
|
|
375
1270
|
*/
|
|
376
1271
|
interface FrontmatterProblem {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
1272
|
+
kind: "unterminated" | "invalid" | "not-a-mapping";
|
|
1273
|
+
/** The delimiter the document opened with. */
|
|
1274
|
+
delimiter: string;
|
|
1275
|
+
message?: string;
|
|
1276
|
+
line?: number;
|
|
1277
|
+
column?: number;
|
|
383
1278
|
}
|
|
384
1279
|
interface ParsedFrontmatter {
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
1280
|
+
frontmatter: Record<string, unknown>;
|
|
1281
|
+
body: string;
|
|
1282
|
+
format: FrontmatterFormat;
|
|
1283
|
+
/**
|
|
1284
|
+
* How many source lines the frontmatter block consumed — the shift between a
|
|
1285
|
+
* line number in `body` and the same line in the original file:
|
|
1286
|
+
* `fileLine = bodyLine + bodyLineOffset`.
|
|
1287
|
+
*
|
|
1288
|
+
* Anything that renders `body` and reports line numbers (line anchors, review
|
|
1289
|
+
* comment anchors) has to add this back, or every number it produces points
|
|
1290
|
+
* `bodyLineOffset` lines short of the text it names.
|
|
1291
|
+
*/
|
|
1292
|
+
bodyLineOffset: number;
|
|
1293
|
+
/**
|
|
1294
|
+
* Set when the document opens with a frontmatter delimiter that did not
|
|
1295
|
+
* yield a metadata table. Everything else in this result is unchanged —
|
|
1296
|
+
* this records *why*, it does not change what rendering does.
|
|
1297
|
+
*/
|
|
1298
|
+
problem?: FrontmatterProblem;
|
|
404
1299
|
}
|
|
405
1300
|
/**
|
|
406
1301
|
* Parse frontmatter from markdown content.
|
|
407
1302
|
* Supports YAML (delimited by ---) and TOML (delimited by +++).
|
|
408
1303
|
*/
|
|
409
1304
|
declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
* The `vantage:` frontmatter key — file-scoped chrome (`docs/reference/inline-markup.md`, "File-scoped chrome").
|
|
413
|
-
*
|
|
414
|
-
* One reserved key at the top level of a document's frontmatter, holding the
|
|
415
|
-
* chrome that belongs to the *file* rather than to a section. Today that is one
|
|
416
|
-
* thing: whether the document's lifecycle `status:` is shown as a chip above the
|
|
417
|
-
* metadata card, instead of being buried as one row inside it.
|
|
418
|
-
*
|
|
419
|
-
* Read only at the top level, and **inert on every failure** (P3): an unknown
|
|
420
|
-
* key, a value outside the closed set, or a `vantage:` that is not a table
|
|
421
|
-
* produces no chrome, no throw and no console output. The reasons are returned
|
|
422
|
-
* as data in `issues`, for anything that wants to report them — `vantage-check`
|
|
423
|
-
* does, and it is the only signal an author gets. That split is exactly the one
|
|
424
|
-
* `FrontmatterProblem` already uses in `frontmatter.ts`: the viewer reads the
|
|
425
|
-
* value, the checker reads the reasons.
|
|
426
|
-
*
|
|
427
|
-
* Like `vantageDirectives.ts`, this module is imported by the CLI checker **by
|
|
428
|
-
* relative path**, so it must stay a pure function of already-parsed data: no
|
|
429
|
-
* hast, no React, no filesystem.
|
|
430
|
-
*/
|
|
431
|
-
|
|
1305
|
+
//#endregion
|
|
1306
|
+
//#region src/vantageFrontmatter.d.ts
|
|
432
1307
|
/**
|
|
433
1308
|
* The document lifecycle vocabulary. Closed; extending it is a code change.
|
|
434
1309
|
*
|
|
@@ -462,29 +1337,29 @@ declare const DOC_STATUS_TONES: Readonly<Record<DocStatus, (typeof VANTAGE_TONES
|
|
|
462
1337
|
* says something the document's own `status:` does not.
|
|
463
1338
|
*/
|
|
464
1339
|
type VantageFrontmatterIssue = {
|
|
465
|
-
|
|
466
|
-
|
|
1340
|
+
kind: "not-a-table";
|
|
1341
|
+
value: unknown;
|
|
467
1342
|
} | {
|
|
468
|
-
|
|
469
|
-
|
|
1343
|
+
kind: "unknown-key";
|
|
1344
|
+
key: string;
|
|
470
1345
|
} | {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
1346
|
+
kind: "bad-value";
|
|
1347
|
+
key: string;
|
|
1348
|
+
value: unknown;
|
|
1349
|
+
legal: readonly string[];
|
|
475
1350
|
} | {
|
|
476
|
-
|
|
477
|
-
|
|
1351
|
+
kind: "status-chip-orphan";
|
|
1352
|
+
status: unknown;
|
|
478
1353
|
} | {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
1354
|
+
kind: "status-chip-disagrees";
|
|
1355
|
+
chip: DocStatus;
|
|
1356
|
+
status: unknown;
|
|
482
1357
|
};
|
|
483
1358
|
interface VantageFrontmatter {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
1359
|
+
/** The chip's text, or `undefined` for no chip. */
|
|
1360
|
+
statusChip?: DocStatus;
|
|
1361
|
+
/** Why something was dropped. A viewer must never read this (P3). */
|
|
1362
|
+
issues: VantageFrontmatterIssue[];
|
|
488
1363
|
}
|
|
489
1364
|
/** Narrowing helper the chip and the checker both use. */
|
|
490
1365
|
declare function isDocStatus(value: unknown): value is DocStatus;
|
|
@@ -495,13 +1370,8 @@ declare function isDocStatus(value: unknown): value is DocStatus;
|
|
|
495
1370
|
* in twice gives equal results out.
|
|
496
1371
|
*/
|
|
497
1372
|
declare function readVantageFrontmatter(frontmatter: Record<string, unknown>): VantageFrontmatter;
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
* Sanitization schema for the rendering pipeline.
|
|
501
|
-
* Allows GFM, KaTeX MathML, syntax highlighting classes, and
|
|
502
|
-
* data-source-line attributes while blocking XSS vectors.
|
|
503
|
-
*/
|
|
504
|
-
|
|
1373
|
+
//#endregion
|
|
1374
|
+
//#region src/sanitize.d.ts
|
|
505
1375
|
type Schema = typeof defaultSchema;
|
|
506
1376
|
declare const SAFE_STYLE: RegExp;
|
|
507
1377
|
/**
|
|
@@ -517,7 +1387,8 @@ declare const SAFE_STYLE: RegExp;
|
|
|
517
1387
|
* markup") is the guard.
|
|
518
1388
|
*/
|
|
519
1389
|
declare const sanitizeSchema: Schema;
|
|
520
|
-
|
|
1390
|
+
//#endregion
|
|
1391
|
+
//#region src/renderMermaidBlocks.d.ts
|
|
521
1392
|
/**
|
|
522
1393
|
* Client-side utility to find and render mermaid code blocks in a container.
|
|
523
1394
|
*
|
|
@@ -528,10 +1399,10 @@ declare const sanitizeSchema: Schema;
|
|
|
528
1399
|
* Framework-agnostic — works in any browser environment.
|
|
529
1400
|
*/
|
|
530
1401
|
interface RenderMermaidOptions {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
1402
|
+
/** CSS class to add to the SVG wrapper div (default: "mermaid") */
|
|
1403
|
+
className?: string;
|
|
1404
|
+
/** Called when a diagram fails to render */
|
|
1405
|
+
onError?: (code: string, error: Error) => void;
|
|
535
1406
|
}
|
|
536
1407
|
/**
|
|
537
1408
|
* Find all `<pre><code class="language-mermaid">` blocks in a container
|
|
@@ -551,7 +1422,8 @@ interface RenderMermaidOptions {
|
|
|
551
1422
|
* ```
|
|
552
1423
|
*/
|
|
553
1424
|
declare function renderMermaidBlocks(container: HTMLElement, options?: RenderMermaidOptions): Promise<void>;
|
|
554
|
-
|
|
1425
|
+
//#endregion
|
|
1426
|
+
//#region src/resolveLinks.d.ts
|
|
555
1427
|
/**
|
|
556
1428
|
* Rewrite relative links in rendered markdown HTML.
|
|
557
1429
|
*
|
|
@@ -560,16 +1432,16 @@ declare function renderMermaidBlocks(container: HTMLElement, options?: RenderMer
|
|
|
560
1432
|
* without requiring a DOM — it operates on the HTML string directly.
|
|
561
1433
|
*/
|
|
562
1434
|
interface ResolveLinkOptions {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
1435
|
+
/** Base path to prepend to relative links (default: "/") */
|
|
1436
|
+
basePath?: string;
|
|
1437
|
+
/**
|
|
1438
|
+
* Custom rewriter function. Called for every relative href.
|
|
1439
|
+
* Return the rewritten href, or null to leave it unchanged.
|
|
1440
|
+
* If provided, basePath is ignored.
|
|
1441
|
+
*/
|
|
1442
|
+
rewriter?: (href: string, currentPath: string) => string | null;
|
|
1443
|
+
/** Current file path — used to resolve relative references like `./other.md` */
|
|
1444
|
+
currentPath?: string;
|
|
573
1445
|
}
|
|
574
1446
|
/**
|
|
575
1447
|
* Rewrite relative links in rendered HTML.
|
|
@@ -596,7 +1468,8 @@ interface ResolveLinkOptions {
|
|
|
596
1468
|
* ```
|
|
597
1469
|
*/
|
|
598
1470
|
declare function resolveLinks(html: string, options?: ResolveLinkOptions): string;
|
|
599
|
-
|
|
1471
|
+
//#endregion
|
|
1472
|
+
//#region src/styleGuide.d.ts
|
|
600
1473
|
/**
|
|
601
1474
|
* The canonical Vantage Markdown style guide.
|
|
602
1475
|
*
|
|
@@ -611,6 +1484,7 @@ declare function resolveLinks(html: string, options?: ResolveLinkOptions): strin
|
|
|
611
1484
|
* Every rule stated here should be one a checker can enforce or a renderer
|
|
612
1485
|
* actually cares about — if a line is neither, it does not belong.
|
|
613
1486
|
*/
|
|
614
|
-
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
|
|
615
|
-
|
|
1487
|
+
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- **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";
|
|
1488
|
+
//#endregion
|
|
616
1489
|
export { DIRECTIVE_NAMES, DIRECTIVE_VOCABULARY, DOC_STATUSES, DOC_STATUS_TONES, 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, SAFE_STYLE, STYLE_GUIDE, VANTAGE_BADGES, VANTAGE_COLLAPSED, VANTAGE_EMPHASIS, VANTAGE_FRONTMATTER_KEYS, VANTAGE_OQ_HOST_TARGETS, VANTAGE_RUNS, VANTAGE_SENTINEL, VANTAGE_TONES, type VantageFrontmatter, type VantageFrontmatterIssue, buildPipeline, buildRemarkPlugins, clearLineAnchorHighlights, hasVantageSentinel, isDocStatus, parseFrontmatter, parseLineAnchor, parseVantageDirective, readVantageFrontmatter, rehypeSourceLines, rehypeVantageDirectives, renderMarkdown, renderMermaidBlocks, resolveLinks, sanitizeSchema, scrollToLineAnchor };
|
|
1490
|
+
//# sourceMappingURL=index.d.cts.map
|