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