@ox-content/napi 3.0.0-alpha.8 → 3.0.0-beta.0
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/index.d.ts +811 -4
- package/index.js +18 -0
- package/package.json +8 -8
package/index.d.ts
CHANGED
|
@@ -45,6 +45,9 @@ export declare class IncrementalMarkdownRenderer {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare function applyPendingHighlights(html: string, replacements: Array<string>): string
|
|
47
47
|
|
|
48
|
+
/** Rewrites rendered article HTML with reader-chrome controls. */
|
|
49
|
+
export declare function applySsgReaderChromeHtml(html: string, chrome?: JsReaderChrome | undefined | null): string
|
|
50
|
+
|
|
48
51
|
/**
|
|
49
52
|
* Builds a Markdown collection manifest directly from files on the Rust side.
|
|
50
53
|
*
|
|
@@ -149,6 +152,12 @@ export declare function extractSsgTitle(content: string, frontmatterTitle?: stri
|
|
|
149
152
|
*/
|
|
150
153
|
export declare function extractTranslationKeys(source: string, filePath: string, functionNames?: Array<string> | undefined | null): Array<I18NKeyUsage>
|
|
151
154
|
|
|
155
|
+
/**
|
|
156
|
+
* Extracts a YouTube video id from a bare id or a watch / share / embed /
|
|
157
|
+
* shorts URL, returning `null` when the input names no video.
|
|
158
|
+
*/
|
|
159
|
+
export declare function extractYoutubeVideoId(input: string): string | null
|
|
160
|
+
|
|
152
161
|
/** Formats a file or directory segment as an SSG title. */
|
|
153
162
|
export declare function formatSsgTitle(name: string): string
|
|
154
163
|
|
|
@@ -172,6 +181,9 @@ export declare function generateDocsNavMetadata(files: Array<string>, basePath?:
|
|
|
172
181
|
*/
|
|
173
182
|
export declare function generateDocsNavMetadataFromDocs(docs: Array<JsDocsMarkdownModule>, options?: JsDocsNavOptions | undefined | null): Array<JsDocsNavItem>
|
|
174
183
|
|
|
184
|
+
/** Builds RSS / Atom / JSON Feed bodies without writing files. */
|
|
185
|
+
export declare function generateFeedBodies(options: JsFeedsOptions, items: Array<JsFeedItem>): JsFeedsOutput
|
|
186
|
+
|
|
175
187
|
/** Generates the `virtual:ox-content/i18n` runtime module. */
|
|
176
188
|
export declare function generateI18nModule(dictDir: string, config: JsI18NRuntimeConfig): string
|
|
177
189
|
|
|
@@ -183,12 +195,18 @@ export declare function generateI18nModule(dictDir: string, config: JsI18NRuntim
|
|
|
183
195
|
*/
|
|
184
196
|
export declare function generateOgImageSvg(data: JsOgImageData, config?: JsOgImageConfig | undefined | null): string
|
|
185
197
|
|
|
198
|
+
/** Generates static OpenAPI reference Markdown pages from local JSON/YAML files. */
|
|
199
|
+
export declare function generateOpenApiDocs(inputs: Array<JsOpenApiDocsInput>, options?: JsOpenApiDocsOptions | undefined | null): JsGeneratedOpenApiDocs
|
|
200
|
+
|
|
186
201
|
/** Generates the client-side search runtime module. */
|
|
187
202
|
export declare function generateSearchModule(optionsJson: string, indexPath: string): string
|
|
188
203
|
|
|
189
204
|
/** Generates the client-side search runtime module from typed options. */
|
|
190
205
|
export declare function generateSearchModuleFromOptions(options: JsSearchRuntimeOptions, indexPath: string): string
|
|
191
206
|
|
|
207
|
+
/** Builds `sitemap.xml`, `robots.txt`, and `llms.txt` bodies without writing files. */
|
|
208
|
+
export declare function generateSiteMapBodies(options: JsSiteMapsOptions, pages: Array<JsSiteMapPage>): JsSiteMapsOutput
|
|
209
|
+
|
|
192
210
|
/** Generates a bare SSG HTML page without navigation or styles. */
|
|
193
211
|
export declare function generateSsgBareHtml(content: string, title: string): string
|
|
194
212
|
|
|
@@ -216,6 +234,12 @@ export declare function getSsgOutputPath(inputPath: string, srcDir: string, outD
|
|
|
216
234
|
/** Resolves a page locale from an SSG URL path and configured locale codes. */
|
|
217
235
|
export declare function getSsgPageLocale(urlPath: string, defaultLocale: string, localeCodes: Array<string>): string | null
|
|
218
236
|
|
|
237
|
+
/** CSS used by the built-in reader chrome and custom hosts. */
|
|
238
|
+
export declare function getSsgReaderChromeCss(): string
|
|
239
|
+
|
|
240
|
+
/** Auto-initializing browser script used by the built-in reader chrome. */
|
|
241
|
+
export declare function getSsgReaderChromeScript(): string
|
|
242
|
+
|
|
219
243
|
/** Converts a markdown file path to a relative SSG URL path. */
|
|
220
244
|
export declare function getSsgUrlPath(inputPath: string, srcDir: string): string
|
|
221
245
|
|
|
@@ -329,12 +353,37 @@ export interface IncrementalMarkdownRenderResult {
|
|
|
329
353
|
errors: Array<string>
|
|
330
354
|
}
|
|
331
355
|
|
|
356
|
+
/** Same-origin path check: leading `/`, not `//`, and no scheme. */
|
|
357
|
+
export declare function isSafeRedirectDest(value: string): boolean
|
|
358
|
+
|
|
332
359
|
/** Opt-in skip link and print styles. Presence of the object enables the feature. */
|
|
333
360
|
export interface JsA11y {
|
|
334
361
|
/** Override for the skip-link label. Empty / omitted uses "Skip to content". */
|
|
335
362
|
skipLinkLabel?: string
|
|
336
363
|
}
|
|
337
364
|
|
|
365
|
+
/** Opt-in abbreviation and glossary expansion. */
|
|
366
|
+
export interface JsAbbreviationsOptions {
|
|
367
|
+
/**
|
|
368
|
+
* Enable `*[TERM]: expansion` and config-term rewriting.
|
|
369
|
+
*
|
|
370
|
+
* Default: `false`.
|
|
371
|
+
*/
|
|
372
|
+
enabled?: boolean
|
|
373
|
+
/**
|
|
374
|
+
* Central glossary terms. Keys are matched with Unicode word boundaries.
|
|
375
|
+
*
|
|
376
|
+
* Default: `{}`.
|
|
377
|
+
*/
|
|
378
|
+
terms?: Record<string, string>
|
|
379
|
+
/**
|
|
380
|
+
* Wrap only the first occurrence of each term.
|
|
381
|
+
*
|
|
382
|
+
* Default: `false` (every occurrence).
|
|
383
|
+
*/
|
|
384
|
+
firstUseOnly?: boolean
|
|
385
|
+
}
|
|
386
|
+
|
|
338
387
|
/** Attribute syntax transform options. */
|
|
339
388
|
export interface JsAttrsOptions {
|
|
340
389
|
/**
|
|
@@ -427,6 +476,16 @@ export interface JsCodeBlockLintOptions {
|
|
|
427
476
|
trailingSpaces?: boolean
|
|
428
477
|
}
|
|
429
478
|
|
|
479
|
+
/** Opt-in `::: code-group` fence groups. */
|
|
480
|
+
export interface JsCodeGroupOptions {
|
|
481
|
+
/**
|
|
482
|
+
* Enable VitePress-style `::: code-group` rewriting.
|
|
483
|
+
*
|
|
484
|
+
* Default: `false`.
|
|
485
|
+
*/
|
|
486
|
+
enabled?: boolean
|
|
487
|
+
}
|
|
488
|
+
|
|
430
489
|
/** Code import / snippet injection options. */
|
|
431
490
|
export interface JsCodeImportOptions {
|
|
432
491
|
/**
|
|
@@ -452,6 +511,22 @@ export interface JsCollectionDefinition {
|
|
|
452
511
|
include: Array<string>
|
|
453
512
|
}
|
|
454
513
|
|
|
514
|
+
/** Opt-in static `::: if` / `::: else` conditional blocks. */
|
|
515
|
+
export interface JsConditionalBlockOptions {
|
|
516
|
+
/**
|
|
517
|
+
* Enable conditional block evaluation.
|
|
518
|
+
*
|
|
519
|
+
* Default: `true` when the options object is supplied.
|
|
520
|
+
*/
|
|
521
|
+
enabled?: boolean
|
|
522
|
+
/**
|
|
523
|
+
* Build-time values available as `config.*` or bare identifiers.
|
|
524
|
+
*
|
|
525
|
+
* Default: `{}`.
|
|
526
|
+
*/
|
|
527
|
+
values?: Record<string, any>
|
|
528
|
+
}
|
|
529
|
+
|
|
455
530
|
/** Opt-in `::: tip` custom containers. */
|
|
456
531
|
export interface JsContainerOptions {
|
|
457
532
|
/**
|
|
@@ -472,6 +547,81 @@ export interface JsContainerTypeOptions {
|
|
|
472
547
|
tag?: string
|
|
473
548
|
}
|
|
474
549
|
|
|
550
|
+
/** One rule the document broke. */
|
|
551
|
+
export interface JsCrossReferenceDiagnostic {
|
|
552
|
+
/** `"error"` or `"warn"`, as the options asked. */
|
|
553
|
+
policy: string
|
|
554
|
+
message: string
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/** One numbered target the document defines. */
|
|
558
|
+
export interface JsCrossReferenceEntry {
|
|
559
|
+
id: string
|
|
560
|
+
/** `"figure"`, `"table"`, or `"section"`. */
|
|
561
|
+
kind: string
|
|
562
|
+
number: string
|
|
563
|
+
label: string
|
|
564
|
+
text: string
|
|
565
|
+
href: string
|
|
566
|
+
title?: string
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/** The word placed before each number, per kind. */
|
|
570
|
+
export interface JsCrossReferenceLabels {
|
|
571
|
+
figure?: string
|
|
572
|
+
table?: string
|
|
573
|
+
section?: string
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** The annotated HTML, what it defined, and what it got wrong. */
|
|
577
|
+
export interface JsCrossReferenceOutput {
|
|
578
|
+
html: string
|
|
579
|
+
references: Array<JsCrossReferenceEntry>
|
|
580
|
+
diagnostics: Array<JsCrossReferenceDiagnostic>
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/** Switches and labels for the cross-reference pass. */
|
|
584
|
+
export interface JsCrossReferencesOptions {
|
|
585
|
+
enabled: boolean
|
|
586
|
+
/** `"warn"` reports and carries on; anything else fails the build. */
|
|
587
|
+
missing?: string
|
|
588
|
+
duplicates?: string
|
|
589
|
+
mismatches?: string
|
|
590
|
+
labels?: JsCrossReferenceLabels
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/** Opt-in static `csv-table` / `json-table` fences. */
|
|
594
|
+
export interface JsDataTableOptions {
|
|
595
|
+
/**
|
|
596
|
+
* Enable `csv-table` and `json-table` fences.
|
|
597
|
+
*
|
|
598
|
+
* Default: `false`.
|
|
599
|
+
*/
|
|
600
|
+
enabled?: boolean
|
|
601
|
+
/**
|
|
602
|
+
* Root directory used for `@/` and absolute data-table imports.
|
|
603
|
+
*
|
|
604
|
+
* Default: project root from the JavaScript caller.
|
|
605
|
+
*/
|
|
606
|
+
rootDir?: string
|
|
607
|
+
/**
|
|
608
|
+
* What to do when an imported file is missing.
|
|
609
|
+
*
|
|
610
|
+
* Default: `"error"`.
|
|
611
|
+
*/
|
|
612
|
+
missing?: string
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/** Opt-in PHP Markdown Extra / mdBook-style definition lists. */
|
|
616
|
+
export interface JsDefinitionListOptions {
|
|
617
|
+
/**
|
|
618
|
+
* Enable `Term` / `: definition` expansion.
|
|
619
|
+
*
|
|
620
|
+
* Default: `false`.
|
|
621
|
+
*/
|
|
622
|
+
enabled?: boolean
|
|
623
|
+
}
|
|
624
|
+
|
|
475
625
|
/** Normalized documentation entry used by generated API docs. */
|
|
476
626
|
export interface JsDocEntry {
|
|
477
627
|
name: string
|
|
@@ -744,11 +894,35 @@ export interface JsEditThisPageOptions {
|
|
|
744
894
|
*/
|
|
745
895
|
branch?: string
|
|
746
896
|
/**
|
|
747
|
-
*
|
|
897
|
+
* Where the source root sits inside the repository. Prefixed to the
|
|
898
|
+
* page path, which is then taken relative to `src_dir`.
|
|
748
899
|
*
|
|
749
|
-
* Default: no
|
|
900
|
+
* Default: no prefix, and the page path stays relative to the process's
|
|
901
|
+
* working directory.
|
|
750
902
|
*/
|
|
751
903
|
rootDir?: string
|
|
904
|
+
/**
|
|
905
|
+
* Absolute path of the source root on disk, supplied by the build so
|
|
906
|
+
* `root_dir` can be joined with the page's path inside that root.
|
|
907
|
+
*
|
|
908
|
+
* Default: none, which makes `root_dir` inert.
|
|
909
|
+
*/
|
|
910
|
+
srcDir?: string
|
|
911
|
+
/**
|
|
912
|
+
* Forge whose edit-URL shape to use: `github`, `gitlab`, `bitbucket`,
|
|
913
|
+
* or `gitea`.
|
|
914
|
+
*
|
|
915
|
+
* Default: inferred from the `repo_url` host, falling back to
|
|
916
|
+
* `github`. An unrecognized value is inferred the same way.
|
|
917
|
+
*/
|
|
918
|
+
provider?: string
|
|
919
|
+
/**
|
|
920
|
+
* Edit-URL template, which wins over `provider`. Understands
|
|
921
|
+
* `{repoUrl}`, `{branch}`, and `{path}`; other braces stay literal.
|
|
922
|
+
*
|
|
923
|
+
* Default: the pattern for the resolved provider.
|
|
924
|
+
*/
|
|
925
|
+
urlPattern?: string
|
|
752
926
|
/**
|
|
753
927
|
* Link label.
|
|
754
928
|
*
|
|
@@ -757,6 +931,34 @@ export interface JsEditThisPageOptions {
|
|
|
757
931
|
label?: string
|
|
758
932
|
}
|
|
759
933
|
|
|
934
|
+
/**
|
|
935
|
+
* Transform opt-in static media embed components in already-rendered HTML.
|
|
936
|
+
* One tag an enabled provider refused, and what the transform did instead.
|
|
937
|
+
*/
|
|
938
|
+
export interface JsEmbedDiagnostic {
|
|
939
|
+
/** Tag name as the provider registers it, for example `speakerdeck`. */
|
|
940
|
+
provider: string
|
|
941
|
+
/** The URL the tag carried, when it carried one worth naming. */
|
|
942
|
+
url?: string
|
|
943
|
+
/** 1-based line of the opening tag in the transformed HTML. */
|
|
944
|
+
line: number
|
|
945
|
+
/**
|
|
946
|
+
* `"linked"` when the tag became a plain link, `"kept"` when its markup
|
|
947
|
+
* was left as authored.
|
|
948
|
+
*/
|
|
949
|
+
fallback: string
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
/** One provider tag as authors write it. */
|
|
953
|
+
export interface JsEmbedTag {
|
|
954
|
+
name: string
|
|
955
|
+
/**
|
|
956
|
+
* True when only the PascalCase spelling is an embed, because the
|
|
957
|
+
* lowercase one is a real HTML element.
|
|
958
|
+
*/
|
|
959
|
+
pascalOnly: boolean
|
|
960
|
+
}
|
|
961
|
+
|
|
760
962
|
/** Emoji-shortcode transform options. */
|
|
761
963
|
export interface JsEmojiShortcodeOptions {
|
|
762
964
|
/**
|
|
@@ -867,6 +1069,65 @@ export interface JsFeatureConfig {
|
|
|
867
1069
|
linkText?: string
|
|
868
1070
|
}
|
|
869
1071
|
|
|
1072
|
+
/** A file carried alongside a feed item. */
|
|
1073
|
+
export interface JsFeedAttachment {
|
|
1074
|
+
url: string
|
|
1075
|
+
mimeType?: string
|
|
1076
|
+
title?: string
|
|
1077
|
+
sizeInBytes?: number
|
|
1078
|
+
durationInSeconds?: number
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/** A person credited on a feed item. */
|
|
1082
|
+
export interface JsFeedAuthor {
|
|
1083
|
+
name: string
|
|
1084
|
+
url?: string
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/** One collection entry considered for a feed. */
|
|
1088
|
+
export interface JsFeedItem {
|
|
1089
|
+
title: string
|
|
1090
|
+
description?: string
|
|
1091
|
+
loc: string
|
|
1092
|
+
date?: string
|
|
1093
|
+
lastUpdated?: string
|
|
1094
|
+
draft?: boolean
|
|
1095
|
+
unlisted?: boolean
|
|
1096
|
+
content?: string
|
|
1097
|
+
id?: string
|
|
1098
|
+
authors?: Array<JsFeedAuthor>
|
|
1099
|
+
image?: string
|
|
1100
|
+
attachments?: Array<JsFeedAttachment>
|
|
1101
|
+
language?: string
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/** Switches and site metadata for feed generation. */
|
|
1105
|
+
export interface JsFeedsOptions {
|
|
1106
|
+
enabled: boolean
|
|
1107
|
+
siteUrl?: string
|
|
1108
|
+
siteName: string
|
|
1109
|
+
siteDescription?: string
|
|
1110
|
+
homePageUrl: string
|
|
1111
|
+
rssUrl: string
|
|
1112
|
+
atomUrl: string
|
|
1113
|
+
jsonUrl: string
|
|
1114
|
+
/** Any of `"rss"`, `"atom"`, `"json"`. Unknown names are ignored. */
|
|
1115
|
+
formats: Array<string>
|
|
1116
|
+
limit: number
|
|
1117
|
+
language?: string
|
|
1118
|
+
image?: string
|
|
1119
|
+
favicon?: string
|
|
1120
|
+
copyright?: string
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
/** Generated feed bodies, or a warning when generation is skipped. */
|
|
1124
|
+
export interface JsFeedsOutput {
|
|
1125
|
+
rssXml?: string
|
|
1126
|
+
atomXml?: string
|
|
1127
|
+
jsonFeed?: string
|
|
1128
|
+
warning?: string
|
|
1129
|
+
}
|
|
1130
|
+
|
|
870
1131
|
/** Opt-in static `file-tree` fences. */
|
|
871
1132
|
export interface JsFileTreeOptions {
|
|
872
1133
|
/**
|
|
@@ -904,6 +1165,12 @@ export interface JsFrameworkComponentIsland {
|
|
|
904
1165
|
content?: string
|
|
905
1166
|
}
|
|
906
1167
|
|
|
1168
|
+
/** Generated OpenAPI Markdown pages and navigation metadata. */
|
|
1169
|
+
export interface JsGeneratedOpenApiDocs {
|
|
1170
|
+
pages: Record<string, string>
|
|
1171
|
+
nav: Array<JsDocsNavItem>
|
|
1172
|
+
}
|
|
1173
|
+
|
|
907
1174
|
/** One unique git author returned by `getGitContributors`. */
|
|
908
1175
|
export interface JsGitContributor {
|
|
909
1176
|
/** Author name from `%an`. */
|
|
@@ -1026,6 +1293,34 @@ export interface JsI18NRuntimeLocale {
|
|
|
1026
1293
|
dir?: string
|
|
1027
1294
|
}
|
|
1028
1295
|
|
|
1296
|
+
/** Opt-in static `::: gallery` image groups. */
|
|
1297
|
+
export interface JsImageGalleryOptions {
|
|
1298
|
+
/**
|
|
1299
|
+
* Enable static image gallery blocks.
|
|
1300
|
+
*
|
|
1301
|
+
* Default: `false`.
|
|
1302
|
+
*/
|
|
1303
|
+
enabled?: boolean
|
|
1304
|
+
/**
|
|
1305
|
+
* Add `loading="lazy"` to images inside galleries.
|
|
1306
|
+
*
|
|
1307
|
+
* Default: follows `images.lazy`, or `true` when `images` is disabled.
|
|
1308
|
+
*/
|
|
1309
|
+
lazy?: boolean
|
|
1310
|
+
/**
|
|
1311
|
+
* Validation mode for images with empty alt text.
|
|
1312
|
+
*
|
|
1313
|
+
* Default: `"error"`.
|
|
1314
|
+
*/
|
|
1315
|
+
missingAlt?: string
|
|
1316
|
+
/**
|
|
1317
|
+
* Validation mode for galleries without image items.
|
|
1318
|
+
*
|
|
1319
|
+
* Default: `"error"`.
|
|
1320
|
+
*/
|
|
1321
|
+
empty?: string
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1029
1324
|
/** Opt-in figures, captions, and lazy images. */
|
|
1030
1325
|
export interface JsImageOptions {
|
|
1031
1326
|
/**
|
|
@@ -1098,6 +1393,28 @@ export interface JsJsonLdPublisher {
|
|
|
1098
1393
|
url?: string
|
|
1099
1394
|
}
|
|
1100
1395
|
|
|
1396
|
+
/** Opt-in `{kbd:...}` inline keyboard keys. */
|
|
1397
|
+
export interface JsKeyboardKeysOptions {
|
|
1398
|
+
/**
|
|
1399
|
+
* Enable `{kbd:Ctrl+K}` expansion.
|
|
1400
|
+
*
|
|
1401
|
+
* Default: `false`.
|
|
1402
|
+
*/
|
|
1403
|
+
enabled?: boolean
|
|
1404
|
+
/**
|
|
1405
|
+
* Build-time key aliases. Keys are matched case-insensitively.
|
|
1406
|
+
*
|
|
1407
|
+
* Default: `{}`.
|
|
1408
|
+
*/
|
|
1409
|
+
aliases?: Record<string, string>
|
|
1410
|
+
/**
|
|
1411
|
+
* Label style for built-in aliases: `"words"` or `"symbols"`.
|
|
1412
|
+
*
|
|
1413
|
+
* Default: `"words"`.
|
|
1414
|
+
*/
|
|
1415
|
+
style?: string
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1101
1418
|
/** Locale information for the locale switcher. */
|
|
1102
1419
|
export interface JsLocaleInfo {
|
|
1103
1420
|
/** BCP 47 locale tag. */
|
|
@@ -1223,6 +1540,16 @@ export interface JsMathOptions {
|
|
|
1223
1540
|
enabled?: boolean
|
|
1224
1541
|
}
|
|
1225
1542
|
|
|
1543
|
+
/** A parsed document on its way to a JavaScript `transformers` hook. */
|
|
1544
|
+
export interface JsMdastTransformResult {
|
|
1545
|
+
/** The tree, as mdast JSON. */
|
|
1546
|
+
astJson: string
|
|
1547
|
+
/** Frontmatter as JSON, which the tree has no room for. */
|
|
1548
|
+
frontmatter: string
|
|
1549
|
+
/** Preprocessing and parse errors collected so far. */
|
|
1550
|
+
errors: Array<string>
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1226
1553
|
/** Built-in media embed transform switches. */
|
|
1227
1554
|
export interface JsMediaEmbedsOptions {
|
|
1228
1555
|
/**
|
|
@@ -1231,6 +1558,18 @@ export interface JsMediaEmbedsOptions {
|
|
|
1231
1558
|
* Default: `false`.
|
|
1232
1559
|
*/
|
|
1233
1560
|
spotify?: boolean
|
|
1561
|
+
/**
|
|
1562
|
+
* Render `<AppleMusic>` embeds.
|
|
1563
|
+
*
|
|
1564
|
+
* Default: `false`.
|
|
1565
|
+
*/
|
|
1566
|
+
appleMusic?: boolean
|
|
1567
|
+
/**
|
|
1568
|
+
* Render `<SpeakerDeck>` embeds.
|
|
1569
|
+
*
|
|
1570
|
+
* Default: `false`.
|
|
1571
|
+
*/
|
|
1572
|
+
speakerDeck?: boolean
|
|
1234
1573
|
/**
|
|
1235
1574
|
* Render `<StackBlitz>` embeds.
|
|
1236
1575
|
*
|
|
@@ -1249,12 +1588,154 @@ export interface JsMediaEmbedsOptions {
|
|
|
1249
1588
|
* Default: `false`.
|
|
1250
1589
|
*/
|
|
1251
1590
|
bluesky?: boolean
|
|
1591
|
+
/**
|
|
1592
|
+
* Render `<GoogleMaps>` static place cards.
|
|
1593
|
+
*
|
|
1594
|
+
* Default: `false`.
|
|
1595
|
+
*/
|
|
1596
|
+
googleMaps?: boolean
|
|
1597
|
+
/**
|
|
1598
|
+
* Render `<Qiita>` static article cards.
|
|
1599
|
+
*
|
|
1600
|
+
* Default: `false`.
|
|
1601
|
+
*/
|
|
1602
|
+
qiita?: boolean
|
|
1603
|
+
/**
|
|
1604
|
+
* Render `<Zenn>` static article cards.
|
|
1605
|
+
*
|
|
1606
|
+
* Default: `false`.
|
|
1607
|
+
*/
|
|
1608
|
+
zenn?: boolean
|
|
1609
|
+
/**
|
|
1610
|
+
* Render package registry cards for npm, crates.io, PyPI, and Docker Hub.
|
|
1611
|
+
*
|
|
1612
|
+
* Default: `false`.
|
|
1613
|
+
*/
|
|
1614
|
+
packageRegistry?: boolean
|
|
1615
|
+
/**
|
|
1616
|
+
* Render `<CodePen>`, `<JSFiddle>`, and `<Observable>` playground cards.
|
|
1617
|
+
*
|
|
1618
|
+
* Default: `false`.
|
|
1619
|
+
*/
|
|
1620
|
+
playgrounds?: boolean
|
|
1621
|
+
/**
|
|
1622
|
+
* Render `<Vimeo>` video cards.
|
|
1623
|
+
*
|
|
1624
|
+
* Default: `false`.
|
|
1625
|
+
*/
|
|
1626
|
+
vimeo?: boolean
|
|
1627
|
+
/**
|
|
1628
|
+
* Render `<Twitch>` video, clip, and channel cards.
|
|
1629
|
+
*
|
|
1630
|
+
* Default: `false`.
|
|
1631
|
+
*/
|
|
1632
|
+
twitch?: boolean
|
|
1633
|
+
/**
|
|
1634
|
+
* Render `<Discord>` static invite/message cards.
|
|
1635
|
+
*
|
|
1636
|
+
* Default: `false`.
|
|
1637
|
+
*/
|
|
1638
|
+
discord?: boolean
|
|
1639
|
+
/**
|
|
1640
|
+
* Render `<Fediverse>`, `<Mastodon>`, `<Misskey>`, and `<Mixi2>` static post cards.
|
|
1641
|
+
*
|
|
1642
|
+
* Default: `false`.
|
|
1643
|
+
*/
|
|
1644
|
+
fediverse?: boolean
|
|
1645
|
+
/**
|
|
1646
|
+
* Render `<Facebook>` static post cards.
|
|
1647
|
+
*
|
|
1648
|
+
* Default: `false`.
|
|
1649
|
+
*/
|
|
1650
|
+
facebook?: boolean
|
|
1651
|
+
/**
|
|
1652
|
+
* Render `<Threads>` static post cards.
|
|
1653
|
+
*
|
|
1654
|
+
* Default: `false`.
|
|
1655
|
+
*/
|
|
1656
|
+
threads?: boolean
|
|
1657
|
+
/**
|
|
1658
|
+
* Render `<Instagram>` static post cards.
|
|
1659
|
+
*
|
|
1660
|
+
* Default: `false`.
|
|
1661
|
+
*/
|
|
1662
|
+
instagram?: boolean
|
|
1252
1663
|
/**
|
|
1253
1664
|
* Render `<WebContainer>` lazy placeholder blocks.
|
|
1254
1665
|
*
|
|
1255
1666
|
* Default: `false`.
|
|
1256
1667
|
*/
|
|
1257
1668
|
webContainer?: boolean
|
|
1669
|
+
/**
|
|
1670
|
+
* Render `<Audio>` native players.
|
|
1671
|
+
*
|
|
1672
|
+
* Default: `false`.
|
|
1673
|
+
*/
|
|
1674
|
+
audio?: boolean
|
|
1675
|
+
/**
|
|
1676
|
+
* Render `<Video>` native players.
|
|
1677
|
+
*
|
|
1678
|
+
* Default: `false`.
|
|
1679
|
+
*/
|
|
1680
|
+
video?: boolean
|
|
1681
|
+
/**
|
|
1682
|
+
* Render `<Loom>` recording cards.
|
|
1683
|
+
*
|
|
1684
|
+
* Default: `false`.
|
|
1685
|
+
*/
|
|
1686
|
+
loom?: boolean
|
|
1687
|
+
/**
|
|
1688
|
+
* Render `<Asciinema>` terminal-recording cards.
|
|
1689
|
+
*
|
|
1690
|
+
* Default: `false`.
|
|
1691
|
+
*/
|
|
1692
|
+
asciinema?: boolean
|
|
1693
|
+
/**
|
|
1694
|
+
* Render `<Figma>` file, design, board, and prototype cards.
|
|
1695
|
+
*
|
|
1696
|
+
* Default: `false`.
|
|
1697
|
+
*/
|
|
1698
|
+
figma?: boolean
|
|
1699
|
+
/**
|
|
1700
|
+
* Render `<Note>` note.com article cards.
|
|
1701
|
+
*
|
|
1702
|
+
* Default: `false`.
|
|
1703
|
+
*/
|
|
1704
|
+
note?: boolean
|
|
1705
|
+
/**
|
|
1706
|
+
* Render `<GoogleSlides>` deck cards.
|
|
1707
|
+
*
|
|
1708
|
+
* Default: `false`.
|
|
1709
|
+
*/
|
|
1710
|
+
googleSlides?: boolean
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
/** Rewritten HTML plus every tag an enabled provider refused. */
|
|
1714
|
+
export interface JsMediaEmbedsResult {
|
|
1715
|
+
html: string
|
|
1716
|
+
diagnostics: Array<JsEmbedDiagnostic>
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
/** Opt-in `<NotByAI />` authorship badge. */
|
|
1720
|
+
export interface JsNotByAiOptions {
|
|
1721
|
+
/**
|
|
1722
|
+
* Enable `<NotByAI />` expansion.
|
|
1723
|
+
*
|
|
1724
|
+
* Default: `false`.
|
|
1725
|
+
*/
|
|
1726
|
+
enabled?: boolean
|
|
1727
|
+
/**
|
|
1728
|
+
* Accessible label for the badge link.
|
|
1729
|
+
*
|
|
1730
|
+
* Default: `"Written by human, not by AI"`.
|
|
1731
|
+
*/
|
|
1732
|
+
label?: string
|
|
1733
|
+
/**
|
|
1734
|
+
* Destination URL. Unsafe values fall back to `https://notbyai.fyi`.
|
|
1735
|
+
*
|
|
1736
|
+
* Default: `"https://notbyai.fyi"`.
|
|
1737
|
+
*/
|
|
1738
|
+
href?: string
|
|
1258
1739
|
}
|
|
1259
1740
|
|
|
1260
1741
|
/** OG image configuration for JavaScript. */
|
|
@@ -1285,6 +1766,19 @@ export interface JsOgImageData {
|
|
|
1285
1766
|
author?: string
|
|
1286
1767
|
}
|
|
1287
1768
|
|
|
1769
|
+
/** One local OpenAPI file consumed by the generated docs pipeline. */
|
|
1770
|
+
export interface JsOpenApiDocsInput {
|
|
1771
|
+
path: string
|
|
1772
|
+
name?: string
|
|
1773
|
+
failOnUnresolvedRefs?: boolean
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
/** Options shared by all OpenAPI docs inputs. */
|
|
1777
|
+
export interface JsOpenApiDocsOptions {
|
|
1778
|
+
root?: string
|
|
1779
|
+
basePath?: string
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1288
1782
|
/** Per-page frontmatter chrome flags. */
|
|
1289
1783
|
export interface JsPageChromeFlags {
|
|
1290
1784
|
sidebar?: boolean
|
|
@@ -1306,6 +1800,31 @@ export interface JsPagerOverride {
|
|
|
1306
1800
|
href?: string
|
|
1307
1801
|
}
|
|
1308
1802
|
|
|
1803
|
+
/**
|
|
1804
|
+
* A feed date after parsing: the instant, its civil parts in UTC, and the two
|
|
1805
|
+
* serializations the feed formats ask for.
|
|
1806
|
+
*/
|
|
1807
|
+
export interface JsParsedFeedDate {
|
|
1808
|
+
/** Seconds since the Unix epoch. */
|
|
1809
|
+
unix: number
|
|
1810
|
+
/** Civil year in UTC. */
|
|
1811
|
+
year: number
|
|
1812
|
+
/** Civil month, 1-12. */
|
|
1813
|
+
month: number
|
|
1814
|
+
/** Civil day of month, 1-31. */
|
|
1815
|
+
day: number
|
|
1816
|
+
/** Hour, 0-23. */
|
|
1817
|
+
hour: number
|
|
1818
|
+
/** Minute, 0-59. */
|
|
1819
|
+
minute: number
|
|
1820
|
+
/** Second, 0-60. */
|
|
1821
|
+
second: number
|
|
1822
|
+
/** `YYYY-MM-DDTHH:MM:SSZ`, as Atom and JSON Feed want it. */
|
|
1823
|
+
rfc3339: string
|
|
1824
|
+
/** `Day, DD Mon YYYY HH:MM:SS +0000`, as RSS wants it. */
|
|
1825
|
+
rfc822: string
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1309
1828
|
/**
|
|
1310
1829
|
* Parser options for JavaScript.
|
|
1311
1830
|
*
|
|
@@ -1356,6 +1875,34 @@ export interface JsParserOptions {
|
|
|
1356
1875
|
autolinks?: boolean
|
|
1357
1876
|
}
|
|
1358
1877
|
|
|
1878
|
+
/** Opt-in parameterized Markdown partials. */
|
|
1879
|
+
export interface JsPartialsOptions {
|
|
1880
|
+
/**
|
|
1881
|
+
* Enable `<!-- @partial: PATH k="v" -->` expansion.
|
|
1882
|
+
*
|
|
1883
|
+
* Default: `false`.
|
|
1884
|
+
*/
|
|
1885
|
+
enabled?: boolean
|
|
1886
|
+
/**
|
|
1887
|
+
* Root directory used for `@/` and absolute partial paths.
|
|
1888
|
+
*
|
|
1889
|
+
* Default: project root from the JavaScript caller.
|
|
1890
|
+
*/
|
|
1891
|
+
rootDir?: string
|
|
1892
|
+
/**
|
|
1893
|
+
* Directory used for bare partial names such as `install.md`.
|
|
1894
|
+
*
|
|
1895
|
+
* Default: `"_partials"`.
|
|
1896
|
+
*/
|
|
1897
|
+
root?: string
|
|
1898
|
+
/**
|
|
1899
|
+
* Missing `{{ name }}` substitutions: `"literal"` (default) or `"error"`.
|
|
1900
|
+
*
|
|
1901
|
+
* Default: `"literal"`.
|
|
1902
|
+
*/
|
|
1903
|
+
missing?: string
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1359
1906
|
/** A block the native pass left for the caller's highlighter. */
|
|
1360
1907
|
export interface JsPendingBlock {
|
|
1361
1908
|
/** The `language-…` class the block carries. */
|
|
@@ -1422,12 +1969,63 @@ export interface JsReaderChrome {
|
|
|
1422
1969
|
backToTop?: boolean
|
|
1423
1970
|
}
|
|
1424
1971
|
|
|
1972
|
+
/** One planned static HTML redirect. */
|
|
1973
|
+
export interface JsRedirectEntry {
|
|
1974
|
+
from: string
|
|
1975
|
+
to: string
|
|
1976
|
+
html: string
|
|
1977
|
+
relativePath: string
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
/** One entry of the config rewrite map, in author order. */
|
|
1981
|
+
export interface JsRedirectMapEntry {
|
|
1982
|
+
from: string
|
|
1983
|
+
to: string
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
/** One page that other paths can redirect to. */
|
|
1987
|
+
export interface JsRedirectPage {
|
|
1988
|
+
dest: string
|
|
1989
|
+
aliases?: Array<string>
|
|
1990
|
+
redirect?: string
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
/** Switches and the config rewrite map. */
|
|
1994
|
+
export interface JsRedirectsOptions {
|
|
1995
|
+
enabled: boolean
|
|
1996
|
+
map: Array<JsRedirectMapEntry>
|
|
1997
|
+
netlify: boolean
|
|
1998
|
+
headers: boolean
|
|
1999
|
+
json: boolean
|
|
2000
|
+
allowExternal: boolean
|
|
2001
|
+
html: boolean
|
|
2002
|
+
base?: string
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
/** Planned redirect pages and optional host files. */
|
|
2006
|
+
export interface JsRedirectsOutput {
|
|
2007
|
+
pages: Array<JsRedirectEntry>
|
|
2008
|
+
netlify?: string
|
|
2009
|
+
headers?: string
|
|
2010
|
+
json?: string
|
|
2011
|
+
}
|
|
2012
|
+
|
|
1425
2013
|
/** Resolved source module. */
|
|
1426
2014
|
export interface JsResolvedModule {
|
|
1427
2015
|
path: string
|
|
1428
2016
|
exports: Array<JsPublicExport>
|
|
1429
2017
|
}
|
|
1430
2018
|
|
|
2019
|
+
/** One page after cascade and optional permalink / slug rewriting. */
|
|
2020
|
+
export interface JsResolvedSsgRoutePage {
|
|
2021
|
+
/** Source path relative to the content root. */
|
|
2022
|
+
source: string
|
|
2023
|
+
/** Resolved URL path. */
|
|
2024
|
+
urlPath: string
|
|
2025
|
+
/** Frontmatter after cascade fills. */
|
|
2026
|
+
frontmatter: Record<string, unknown>
|
|
2027
|
+
}
|
|
2028
|
+
|
|
1431
2029
|
/** HTML sanitizer options. */
|
|
1432
2030
|
export interface JsSanitizeOptions {
|
|
1433
2031
|
/**
|
|
@@ -1486,6 +2084,8 @@ export interface JsSearchIndexBuildOptions {
|
|
|
1486
2084
|
publishState?: JsPublishStateOptions
|
|
1487
2085
|
/** Explicit MDX parser override. When omitted, `.mdx` files enable MDX. */
|
|
1488
2086
|
mdx?: boolean
|
|
2087
|
+
/** Conditional blocks are resolved before extracting searchable content. */
|
|
2088
|
+
conditionalBlocks?: JsConditionalBlockOptions
|
|
1489
2089
|
}
|
|
1490
2090
|
|
|
1491
2091
|
/** Search options for JavaScript. */
|
|
@@ -1524,6 +2124,8 @@ export interface JsSearchRuntimeOptions {
|
|
|
1524
2124
|
limit: number
|
|
1525
2125
|
/** Enable prefix matching. */
|
|
1526
2126
|
prefix: boolean
|
|
2127
|
+
/** Enable fuzzy typo-tolerant matching. */
|
|
2128
|
+
fuzzy: boolean
|
|
1527
2129
|
/** Search input placeholder. */
|
|
1528
2130
|
placeholder: string
|
|
1529
2131
|
/** Keyboard shortcut to focus search. */
|
|
@@ -1540,6 +2142,36 @@ export interface JsSectionIndexItem {
|
|
|
1540
2142
|
description?: string
|
|
1541
2143
|
}
|
|
1542
2144
|
|
|
2145
|
+
/** One page considered for the crawl manifests. */
|
|
2146
|
+
export interface JsSiteMapPage {
|
|
2147
|
+
loc: string
|
|
2148
|
+
title: string
|
|
2149
|
+
description?: string
|
|
2150
|
+
/** Source-file git commit time in milliseconds. `None` omits `<lastmod>`. */
|
|
2151
|
+
lastUpdated?: number
|
|
2152
|
+
draft?: boolean
|
|
2153
|
+
unlisted?: boolean
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
/** Switches and site metadata for crawl-manifest generation. */
|
|
2157
|
+
export interface JsSiteMapsOptions {
|
|
2158
|
+
enabled: boolean
|
|
2159
|
+
siteUrl?: string
|
|
2160
|
+
sitemapLoc: string
|
|
2161
|
+
siteName: string
|
|
2162
|
+
siteDescription?: string
|
|
2163
|
+
robots: boolean
|
|
2164
|
+
llms: boolean
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
/** Generated crawl-manifest bodies, or a warning when generation is skipped. */
|
|
2168
|
+
export interface JsSiteMapsOutput {
|
|
2169
|
+
sitemapXml?: string
|
|
2170
|
+
robotsTxt?: string
|
|
2171
|
+
llmsTxt?: string
|
|
2172
|
+
warning?: string
|
|
2173
|
+
}
|
|
2174
|
+
|
|
1543
2175
|
/** Custom social link for JavaScript. */
|
|
1544
2176
|
export interface JsSocialLink {
|
|
1545
2177
|
/** Icon label. */
|
|
@@ -1786,6 +2418,26 @@ export interface JsSsgPageData {
|
|
|
1786
2418
|
robots?: string
|
|
1787
2419
|
/** Frontmatter `canonical`. */
|
|
1788
2420
|
canonical?: string
|
|
2421
|
+
/** Companion `.md` URL when copy-as-markdown chrome is on. */
|
|
2422
|
+
markdownSource?: string
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
/** Resolved page routes plus collision and rejection diagnostics. */
|
|
2426
|
+
export interface JsSsgPageRouteOutput {
|
|
2427
|
+
/** Pages that still have a unique URL. */
|
|
2428
|
+
pages: Array<JsResolvedSsgRoutePage>
|
|
2429
|
+
/** Human-readable collision and rejection messages. */
|
|
2430
|
+
errors: Array<string>
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
/** One page considered for cascade and permalink resolution. */
|
|
2434
|
+
export interface JsSsgRoutePageInput {
|
|
2435
|
+
/** Source path relative to the content root. */
|
|
2436
|
+
source: string
|
|
2437
|
+
/** File-tree URL before permalink or slug rewriting. */
|
|
2438
|
+
fileUrl: string
|
|
2439
|
+
/** Parsed frontmatter object. */
|
|
2440
|
+
frontmatter: Record<string, unknown>
|
|
1789
2441
|
}
|
|
1790
2442
|
|
|
1791
2443
|
/** Resolved SSG output and public route paths. */
|
|
@@ -1908,6 +2560,8 @@ export interface JsThemeColors {
|
|
|
1908
2560
|
export interface JsThemeConfig {
|
|
1909
2561
|
/** Progressive cross-document transitions for same-origin MPA navigation. */
|
|
1910
2562
|
viewTransitions?: boolean
|
|
2563
|
+
/** Circular reveal for a same-document theme change. `"circle"` opts in. */
|
|
2564
|
+
toggleTransition?: string
|
|
1911
2565
|
/** Right-hand "On this page" outline. Omitted and `false` hide it. */
|
|
1912
2566
|
aside?: boolean
|
|
1913
2567
|
/** Breadcrumb trail from the site root through sidebar ancestors. */
|
|
@@ -2010,6 +2664,40 @@ export interface JsThemeLayout {
|
|
|
2010
2664
|
maxContentWidth?: string
|
|
2011
2665
|
}
|
|
2012
2666
|
|
|
2667
|
+
/** Opt-in static `::: timeline` milestone lists. */
|
|
2668
|
+
export interface JsTimelineOptions {
|
|
2669
|
+
/**
|
|
2670
|
+
* Enable static timeline blocks.
|
|
2671
|
+
*
|
|
2672
|
+
* Default: `false`.
|
|
2673
|
+
*/
|
|
2674
|
+
enabled?: boolean
|
|
2675
|
+
/**
|
|
2676
|
+
* Render timelines as ordered lists unless a block overrides it.
|
|
2677
|
+
*
|
|
2678
|
+
* Default: `true`.
|
|
2679
|
+
*/
|
|
2680
|
+
ordered?: boolean
|
|
2681
|
+
/**
|
|
2682
|
+
* Validation mode for malformed dates.
|
|
2683
|
+
*
|
|
2684
|
+
* Default: `"error"`.
|
|
2685
|
+
*/
|
|
2686
|
+
invalidDate?: string
|
|
2687
|
+
/**
|
|
2688
|
+
* Validation mode for unsupported item metadata.
|
|
2689
|
+
*
|
|
2690
|
+
* Default: `"error"`.
|
|
2691
|
+
*/
|
|
2692
|
+
unknownMeta?: string
|
|
2693
|
+
/**
|
|
2694
|
+
* Validation mode for timeline blocks without items.
|
|
2695
|
+
*
|
|
2696
|
+
* Default: `"error"`.
|
|
2697
|
+
*/
|
|
2698
|
+
empty?: string
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2013
2701
|
/**
|
|
2014
2702
|
* Transform options for JavaScript.
|
|
2015
2703
|
*
|
|
@@ -2214,18 +2902,54 @@ export interface JsTransformOptions {
|
|
|
2214
2902
|
* Default: disabled.
|
|
2215
2903
|
*/
|
|
2216
2904
|
includes?: JsIncludeOptions
|
|
2905
|
+
/**
|
|
2906
|
+
* Opt-in parameterized Markdown partials via `<!-- @partial: PATH k="v" -->`.
|
|
2907
|
+
*
|
|
2908
|
+
* Default: disabled.
|
|
2909
|
+
*/
|
|
2910
|
+
partials?: JsPartialsOptions
|
|
2217
2911
|
/**
|
|
2218
2912
|
* Opt-in `::: steps` ordered lists.
|
|
2219
2913
|
*
|
|
2220
2914
|
* Default: disabled.
|
|
2221
2915
|
*/
|
|
2222
2916
|
steps?: JsStepsOptions
|
|
2917
|
+
/**
|
|
2918
|
+
* Opt-in `::: code-group` fence groups.
|
|
2919
|
+
*
|
|
2920
|
+
* Default: disabled.
|
|
2921
|
+
*/
|
|
2922
|
+
codeGroups?: JsCodeGroupOptions
|
|
2223
2923
|
/**
|
|
2224
2924
|
* Opt-in `{badge:variant}` inline badges.
|
|
2225
2925
|
*
|
|
2226
2926
|
* Default: disabled.
|
|
2227
2927
|
*/
|
|
2228
2928
|
badges?: JsBadgeOptions
|
|
2929
|
+
/**
|
|
2930
|
+
* Opt-in `<NotByAI />` authorship badge.
|
|
2931
|
+
*
|
|
2932
|
+
* Default: disabled.
|
|
2933
|
+
*/
|
|
2934
|
+
notByAi?: JsNotByAiOptions
|
|
2935
|
+
/**
|
|
2936
|
+
* Opt-in `{kbd:...}` inline keyboard keys.
|
|
2937
|
+
*
|
|
2938
|
+
* Default: disabled.
|
|
2939
|
+
*/
|
|
2940
|
+
keyboardKeys?: JsKeyboardKeysOptions
|
|
2941
|
+
/**
|
|
2942
|
+
* Opt-in abbreviation and glossary expansion.
|
|
2943
|
+
*
|
|
2944
|
+
* Default: disabled.
|
|
2945
|
+
*/
|
|
2946
|
+
abbreviations?: JsAbbreviationsOptions
|
|
2947
|
+
/**
|
|
2948
|
+
* Opt-in PHP Markdown Extra / mdBook-style definition lists.
|
|
2949
|
+
*
|
|
2950
|
+
* Default: disabled.
|
|
2951
|
+
*/
|
|
2952
|
+
definitionLists?: JsDefinitionListOptions
|
|
2229
2953
|
/**
|
|
2230
2954
|
* Opt-in `{link:...}` rich magic links.
|
|
2231
2955
|
*
|
|
@@ -2238,6 +2962,24 @@ export interface JsTransformOptions {
|
|
|
2238
2962
|
* Default: disabled.
|
|
2239
2963
|
*/
|
|
2240
2964
|
images?: JsImageOptions
|
|
2965
|
+
/**
|
|
2966
|
+
* Opt-in static `::: gallery` image groups.
|
|
2967
|
+
*
|
|
2968
|
+
* Default: disabled.
|
|
2969
|
+
*/
|
|
2970
|
+
imageGalleries?: JsImageGalleryOptions
|
|
2971
|
+
/**
|
|
2972
|
+
* Opt-in static `::: timeline` milestone lists.
|
|
2973
|
+
*
|
|
2974
|
+
* Default: disabled.
|
|
2975
|
+
*/
|
|
2976
|
+
timelines?: JsTimelineOptions
|
|
2977
|
+
/**
|
|
2978
|
+
* Opt-in static `::: if` / `::: else` conditional blocks.
|
|
2979
|
+
*
|
|
2980
|
+
* Default: disabled.
|
|
2981
|
+
*/
|
|
2982
|
+
conditionalBlocks?: JsConditionalBlockOptions
|
|
2241
2983
|
/**
|
|
2242
2984
|
* Opt-in `::: card` / `::: link-card` / `::: card-grid` blocks.
|
|
2243
2985
|
*
|
|
@@ -2256,6 +2998,12 @@ export interface JsTransformOptions {
|
|
|
2256
2998
|
* Default: disabled.
|
|
2257
2999
|
*/
|
|
2258
3000
|
fileTree?: JsFileTreeOptions
|
|
3001
|
+
/**
|
|
3002
|
+
* Opt-in static `csv-table` / `json-table` fences.
|
|
3003
|
+
*
|
|
3004
|
+
* Default: disabled.
|
|
3005
|
+
*/
|
|
3006
|
+
dataTables?: JsDataTableOptions
|
|
2259
3007
|
}
|
|
2260
3008
|
|
|
2261
3009
|
/** Type parameter documentation (`<T extends C = D>`) used by generated API docs. */
|
|
@@ -2357,6 +3105,15 @@ export interface MdxImportSpecifier {
|
|
|
2357
3105
|
kind: 'default' | 'named' | 'namespace'
|
|
2358
3106
|
}
|
|
2359
3107
|
|
|
3108
|
+
/**
|
|
3109
|
+
* Every tag the media-embed transform can rewrite.
|
|
3110
|
+
*
|
|
3111
|
+
* A caller that pre-scans a document to decide whether to run the transform
|
|
3112
|
+
* needs this list, and a hand-kept copy drifts — that is how `<CodeSandbox>`
|
|
3113
|
+
* came to be skipped on a page containing nothing else.
|
|
3114
|
+
*/
|
|
3115
|
+
export declare function mediaEmbedTags(): Array<JsEmbedTag>
|
|
3116
|
+
|
|
2360
3117
|
/** Restores code block metadata after JavaScript-side syntax highlighting. */
|
|
2361
3118
|
export declare function mergeHighlightedCodeBlocks(originalHtml: string, highlightedHtml: string): string
|
|
2362
3119
|
|
|
@@ -2381,6 +3138,9 @@ export interface Mf2ValidateResult {
|
|
|
2381
3138
|
/** Every language name and alias the native highlighter answers to. */
|
|
2382
3139
|
export declare function nativeHighlightLanguages(): Array<string>
|
|
2383
3140
|
|
|
3141
|
+
/** Strips a trailing slash except for `/`. Unsafe values return `None`. */
|
|
3142
|
+
export declare function normalizeRedirectPath(value: string): string | null
|
|
3143
|
+
|
|
2384
3144
|
/** Normalizes VitePress-specific frontmatter into ox-content's entry-page shape. */
|
|
2385
3145
|
export declare function normalizeVitePressFrontmatter(frontmatter: any): any
|
|
2386
3146
|
|
|
@@ -2397,6 +3157,13 @@ export declare function parseAndRender(source: string, options?: JsParserOptions
|
|
|
2397
3157
|
/** Parses Markdown and renders to HTML asynchronously (runs on worker thread). */
|
|
2398
3158
|
export declare function parseAndRenderAsync(source: string, options?: JsParserOptions | undefined | null): Promise<unknown>
|
|
2399
3159
|
|
|
3160
|
+
/**
|
|
3161
|
+
* Parses a feed date — an epoch seconds/milliseconds integer, or a civil
|
|
3162
|
+
* date-time with an optional zone offset — returning `null` when the value
|
|
3163
|
+
* names no instant.
|
|
3164
|
+
*/
|
|
3165
|
+
export declare function parseFeedDate(value?: string | undefined | null): JsParsedFeedDate | null
|
|
3166
|
+
|
|
2400
3167
|
/** Parses Markdown source into a raw mdast memory block for JavaScript-side deserialization. */
|
|
2401
3168
|
export declare function parseMdastRaw(source: string, options?: JsParserOptions | undefined | null): Uint8Array
|
|
2402
3169
|
|
|
@@ -2419,6 +3186,9 @@ export declare function parseScopedSearchQuery(query: string): JsScopedSearchQue
|
|
|
2419
3186
|
*/
|
|
2420
3187
|
export declare function parseTransferRaw(source: string, kind: string, options?: JsParserOptions | undefined | null): Uint8Array
|
|
2421
3188
|
|
|
3189
|
+
/** Plans redirect pages and host files without writing anything. */
|
|
3190
|
+
export declare function planRedirects(options: JsRedirectsOptions, pages: Array<JsRedirectPage>): JsRedirectsOutput
|
|
3191
|
+
|
|
2422
3192
|
/** Prepared Markdown source with parsed frontmatter. */
|
|
2423
3193
|
export interface PreparedSourceResult {
|
|
2424
3194
|
/** Markdown content after optional frontmatter removal. */
|
|
@@ -2440,7 +3210,13 @@ export declare function prepareSource(source: string, options?: JsSourceOptions
|
|
|
2440
3210
|
*/
|
|
2441
3211
|
export declare function prepareSourceRaw(source: string, options?: JsSourceOptions | undefined | null): Uint8Array
|
|
2442
3212
|
|
|
2443
|
-
/**
|
|
3213
|
+
/**
|
|
3214
|
+
* Renders an mdast (provided as JSON) to HTML.
|
|
3215
|
+
*
|
|
3216
|
+
* The counterpart to [`parse`]: a tree rewritten in JavaScript comes back
|
|
3217
|
+
* through here and is rendered by the same renderer the original would
|
|
3218
|
+
* have used.
|
|
3219
|
+
*/
|
|
2444
3220
|
export declare function render(astJson: string): RenderResult
|
|
2445
3221
|
|
|
2446
3222
|
/**
|
|
@@ -2454,6 +3230,9 @@ export declare function renderFrameworkComponentCode(html: string, target: strin
|
|
|
2454
3230
|
/** Resolve Unhead-compatible page-head descriptors to HTML. */
|
|
2455
3231
|
export declare function renderHead(inputJson: string): JsSsgHtmlResult
|
|
2456
3232
|
|
|
3233
|
+
/** Static HTML redirect body. `dest` is escaped; callers still validate it. */
|
|
3234
|
+
export declare function renderRedirectHtml(dest: string): string
|
|
3235
|
+
|
|
2457
3236
|
/** Render result containing the HTML output. */
|
|
2458
3237
|
export interface RenderResult {
|
|
2459
3238
|
/** The rendered HTML. */
|
|
@@ -2468,6 +3247,9 @@ export declare function renderSsgSectionIndex(title: string, items: Array<JsSect
|
|
|
2468
3247
|
/** Resolves manual SSG navigation groups. */
|
|
2469
3248
|
export declare function resolveSsgNavigationGroups(navigation: Array<JsSsgNavigationGroup>, base: string, extension: string): Array<JsSsgNavGroup>
|
|
2470
3249
|
|
|
3250
|
+
/** Resolves permalink / slug routes and `_index` frontmatter cascade. */
|
|
3251
|
+
export declare function resolveSsgPageRoutes(pages: Array<JsSsgRoutePageInput>, permalinksEnabled: boolean, cascadeEnabled: boolean): JsSsgPageRouteOutput
|
|
3252
|
+
|
|
2471
3253
|
/** Resolves all output and public route paths for an SSG page. */
|
|
2472
3254
|
export declare function resolveSsgRoutePaths(inputPath: string, srcDir: string, outDir: string, base: string, extension: string, siteUrl?: string | undefined | null): JsSsgRoutePaths
|
|
2473
3255
|
|
|
@@ -2507,6 +3289,29 @@ export declare function transform(source: string, options?: JsTransformOptions |
|
|
|
2507
3289
|
/** Transforms Markdown source asynchronously (runs on worker thread). */
|
|
2508
3290
|
export declare function transformAsync(source: string, options?: JsTransformOptions | undefined | null): Promise<unknown>
|
|
2509
3291
|
|
|
3292
|
+
/** Numbers headings, figures, and tables, and links `@id` references to them. */
|
|
3293
|
+
export declare function transformCrossReferences(html: string, options: JsCrossReferencesOptions): JsCrossReferenceOutput
|
|
3294
|
+
|
|
3295
|
+
/**
|
|
3296
|
+
* Finishes a transform from an mdast a JavaScript `transformers` hook may
|
|
3297
|
+
* have rewritten.
|
|
3298
|
+
*
|
|
3299
|
+
* `transformMdastRaw` produces the tree; this renders it and runs
|
|
3300
|
+
* everything that follows rendering — HTML postprocessing, sanitization,
|
|
3301
|
+
* the table of contents, and the MDX metadata — so a rewritten tree loses
|
|
3302
|
+
* none of it. `frontmatterJson` is carried through untouched.
|
|
3303
|
+
*/
|
|
3304
|
+
export declare function transformFromMdast(astJson: string, frontmatterJson: string, options?: JsTransformOptions | undefined | null): TransformResult
|
|
3305
|
+
|
|
3306
|
+
/**
|
|
3307
|
+
* Runs a transform up to the point where the tree exists.
|
|
3308
|
+
*
|
|
3309
|
+
* The counterpart to `transformFromMdast`: frontmatter is parsed and the
|
|
3310
|
+
* opt-in Markdown features are expanded, then the tree is handed over as
|
|
3311
|
+
* JSON for a `transformers` hook to rewrite.
|
|
3312
|
+
*/
|
|
3313
|
+
export declare function transformMdast(source: string, options?: JsTransformOptions | undefined | null): JsMdastTransformResult
|
|
3314
|
+
|
|
2510
3315
|
/**
|
|
2511
3316
|
* Transforms Markdown into a raw mdast transfer buffer.
|
|
2512
3317
|
*
|
|
@@ -2515,9 +3320,11 @@ export declare function transformAsync(source: string, options?: JsTransformOpti
|
|
|
2515
3320
|
*/
|
|
2516
3321
|
export declare function transformMdastRaw(source: string, options?: JsTransformOptions | undefined | null): Uint8Array
|
|
2517
3322
|
|
|
2518
|
-
/** Transform opt-in static media embed components in already-rendered HTML. */
|
|
2519
3323
|
export declare function transformMediaEmbeds(html: string, options?: JsMediaEmbedsOptions | undefined | null): string
|
|
2520
3324
|
|
|
3325
|
+
/** Rewrites embeds and reports the tags no provider would render. */
|
|
3326
|
+
export declare function transformMediaEmbedsWithDiagnostics(html: string, options?: JsMediaEmbedsOptions | undefined | null): JsMediaEmbedsResult
|
|
3327
|
+
|
|
2521
3328
|
/** Transforms mermaid code blocks in HTML to rendered SVG diagrams. */
|
|
2522
3329
|
export declare function transformMermaid(html: string, mmdcPath: string): MermaidTransformResult
|
|
2523
3330
|
|
package/index.js
CHANGED
|
@@ -171,11 +171,15 @@ module.exports.render = binding.render;
|
|
|
171
171
|
module.exports.transform = binding.transform;
|
|
172
172
|
module.exports.transformAsync = binding.transformAsync;
|
|
173
173
|
module.exports.transformMdastRaw = binding.transformMdastRaw;
|
|
174
|
+
module.exports.transformMdast = binding.transformMdast;
|
|
175
|
+
module.exports.transformFromMdast = binding.transformFromMdast;
|
|
174
176
|
module.exports.sanitizeHtml = binding.sanitizeHtml;
|
|
175
177
|
module.exports.transformMediaEmbeds = binding.transformMediaEmbeds;
|
|
178
|
+
module.exports.transformMediaEmbedsWithDiagnostics = binding.transformMediaEmbedsWithDiagnostics;
|
|
176
179
|
module.exports.transformPmEmbeds = binding.transformPmEmbeds;
|
|
177
180
|
module.exports.transformTabsEmbeds = binding.transformTabsEmbeds;
|
|
178
181
|
module.exports.transformYoutubeEmbeds = binding.transformYoutubeEmbeds;
|
|
182
|
+
module.exports.extractYoutubeVideoId = binding.extractYoutubeVideoId;
|
|
179
183
|
module.exports.extractCodeBlocks = binding.extractCodeBlocks;
|
|
180
184
|
module.exports.lintCodeBlocks = binding.lintCodeBlocks;
|
|
181
185
|
module.exports.extractDocsTests = binding.extractDocsTests;
|
|
@@ -191,6 +195,7 @@ module.exports.generateDocsNavCode = binding.generateDocsNavCode;
|
|
|
191
195
|
module.exports.collectDocsSourceFiles = binding.collectDocsSourceFiles;
|
|
192
196
|
module.exports.generateDocsDataJson = binding.generateDocsDataJson;
|
|
193
197
|
module.exports.generateDocsMarkdown = binding.generateDocsMarkdown;
|
|
198
|
+
module.exports.generateOpenApiDocs = binding.generateOpenApiDocs;
|
|
194
199
|
module.exports.writeGeneratedDocs = binding.writeGeneratedDocs;
|
|
195
200
|
module.exports.buildCollectionManifest = binding.buildCollectionManifest;
|
|
196
201
|
module.exports.mergeHighlightedCodeBlocks = binding.mergeHighlightedCodeBlocks;
|
|
@@ -210,6 +215,9 @@ module.exports.collectSearchMarkdownFiles = binding.collectSearchMarkdownFiles;
|
|
|
210
215
|
module.exports.normalizeVitePressFrontmatter = binding.normalizeVitePressFrontmatter;
|
|
211
216
|
module.exports.generateSsgHtml = binding.generateSsgHtml;
|
|
212
217
|
module.exports.renderHead = binding.renderHead;
|
|
218
|
+
module.exports.applySsgReaderChromeHtml = binding.applySsgReaderChromeHtml;
|
|
219
|
+
module.exports.getSsgReaderChromeCss = binding.getSsgReaderChromeCss;
|
|
220
|
+
module.exports.getSsgReaderChromeScript = binding.getSsgReaderChromeScript;
|
|
213
221
|
module.exports.generateSsgBareHtml = binding.generateSsgBareHtml;
|
|
214
222
|
module.exports.highlightCodeBlock = binding.highlightCodeBlock;
|
|
215
223
|
module.exports.applyPendingHighlights = binding.applyPendingHighlights;
|
|
@@ -220,6 +228,7 @@ module.exports.nativeHighlightLanguages = binding.nativeHighlightLanguages;
|
|
|
220
228
|
module.exports.generateSsgBarePage = binding.generateSsgBarePage;
|
|
221
229
|
module.exports.getGitLastUpdated = binding.getGitLastUpdated;
|
|
222
230
|
module.exports.getGitContributors = binding.getGitContributors;
|
|
231
|
+
module.exports.resolveSsgPageRoutes = binding.resolveSsgPageRoutes;
|
|
223
232
|
module.exports.resolveSsgRoutePaths = binding.resolveSsgRoutePaths;
|
|
224
233
|
module.exports.getSsgOutputPath = binding.getSsgOutputPath;
|
|
225
234
|
module.exports.getSsgUrlPath = binding.getSsgUrlPath;
|
|
@@ -242,4 +251,13 @@ module.exports.checkI18nProject = binding.checkI18nProject;
|
|
|
242
251
|
module.exports.extractTranslationKeys = binding.extractTranslationKeys;
|
|
243
252
|
module.exports.renderFrameworkComponentCode = binding.renderFrameworkComponentCode;
|
|
244
253
|
module.exports.renderSsgSectionIndex = binding.renderSsgSectionIndex;
|
|
254
|
+
module.exports.parseFeedDate = binding.parseFeedDate;
|
|
255
|
+
module.exports.generateFeedBodies = binding.generateFeedBodies;
|
|
256
|
+
module.exports.mediaEmbedTags = binding.mediaEmbedTags;
|
|
257
|
+
module.exports.transformCrossReferences = binding.transformCrossReferences;
|
|
258
|
+
module.exports.planRedirects = binding.planRedirects;
|
|
259
|
+
module.exports.renderRedirectHtml = binding.renderRedirectHtml;
|
|
260
|
+
module.exports.isSafeRedirectDest = binding.isSafeRedirectDest;
|
|
261
|
+
module.exports.normalizeRedirectPath = binding.normalizeRedirectPath;
|
|
262
|
+
module.exports.generateSiteMapBodies = binding.generateSiteMapBodies;
|
|
245
263
|
module.exports.escapeSvelteMarkup = binding.escapeSvelteMarkup;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox-content/napi",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Node.js bindings for Ox Content - High-performance Markdown parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@ox-content/binding-darwin-x64": "3.0.0-
|
|
51
|
-
"@ox-content/binding-darwin-arm64": "3.0.0-
|
|
52
|
-
"@ox-content/binding-linux-x64-gnu": "3.0.0-
|
|
53
|
-
"@ox-content/binding-linux-x64-musl": "3.0.0-
|
|
54
|
-
"@ox-content/binding-linux-arm64-gnu": "3.0.0-
|
|
55
|
-
"@ox-content/binding-linux-arm64-musl": "3.0.0-
|
|
56
|
-
"@ox-content/binding-win32-x64-msvc": "3.0.0-
|
|
50
|
+
"@ox-content/binding-darwin-x64": "3.0.0-beta.0",
|
|
51
|
+
"@ox-content/binding-darwin-arm64": "3.0.0-beta.0",
|
|
52
|
+
"@ox-content/binding-linux-x64-gnu": "3.0.0-beta.0",
|
|
53
|
+
"@ox-content/binding-linux-x64-musl": "3.0.0-beta.0",
|
|
54
|
+
"@ox-content/binding-linux-arm64-gnu": "3.0.0-beta.0",
|
|
55
|
+
"@ox-content/binding-linux-arm64-musl": "3.0.0-beta.0",
|
|
56
|
+
"@ox-content/binding-win32-x64-msvc": "3.0.0-beta.0"
|
|
57
57
|
}
|
|
58
58
|
}
|