vantage-md 0.6.1 → 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.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
- export 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 @@ export declare function renderMarkdown(content: string, options?: RenderOptions)
66
21
  * }
67
22
  * ```
68
23
  */
69
- interface Data$1 {}
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$1 {
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$1 | undefined;
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$1 {}
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$1 {
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$1 {
1870
+ interface Doctype extends Node$2 {
906
1871
  /**
907
1872
  * Node type of HTML document types in hast.
908
1873
  */