@ox-content/napi 3.0.0-alpha.1 → 3.0.0-alpha.10
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 +493 -8
- package/index.js +4 -0
- package/package.json +8 -8
package/index.d.ts
CHANGED
|
@@ -183,6 +183,9 @@ export declare function generateI18nModule(dictDir: string, config: JsI18NRuntim
|
|
|
183
183
|
*/
|
|
184
184
|
export declare function generateOgImageSvg(data: JsOgImageData, config?: JsOgImageConfig | undefined | null): string
|
|
185
185
|
|
|
186
|
+
/** Generates static OpenAPI reference Markdown pages from local JSON/YAML files. */
|
|
187
|
+
export declare function generateOpenApiDocs(inputs: Array<JsOpenApiDocsInput>, options?: JsOpenApiDocsOptions | undefined | null): JsGeneratedOpenApiDocs
|
|
188
|
+
|
|
186
189
|
/** Generates the client-side search runtime module. */
|
|
187
190
|
export declare function generateSearchModule(optionsJson: string, indexPath: string): string
|
|
188
191
|
|
|
@@ -196,7 +199,10 @@ export declare function generateSsgBareHtml(content: string, title: string): str
|
|
|
196
199
|
export declare function generateSsgBarePage(page: JsSsgBarePage): string
|
|
197
200
|
|
|
198
201
|
/** Generates SSG HTML page with navigation and search. */
|
|
199
|
-
export declare function generateSsgHtml(pageData: JsSsgPageData, navGroups: Array<JsSsgNavGroup>, config: JsSsgConfig):
|
|
202
|
+
export declare function generateSsgHtml(pageData: JsSsgPageData, navGroups: Array<JsSsgNavGroup>, config: JsSsgConfig): JsSsgHtmlResult
|
|
203
|
+
|
|
204
|
+
/** Returns unique git authors for a file. Empty when git is missing or fails. */
|
|
205
|
+
export declare function getGitContributors(filePath: string, root?: string | undefined | null): Array<JsGitContributor>
|
|
200
206
|
|
|
201
207
|
/** Returns the last git commit timestamp for a file in milliseconds. */
|
|
202
208
|
export declare function getGitLastUpdated(filePath: string, root?: string | undefined | null): number | null
|
|
@@ -332,6 +338,28 @@ export interface JsA11y {
|
|
|
332
338
|
skipLinkLabel?: string
|
|
333
339
|
}
|
|
334
340
|
|
|
341
|
+
/** Opt-in abbreviation and glossary expansion. */
|
|
342
|
+
export interface JsAbbreviationsOptions {
|
|
343
|
+
/**
|
|
344
|
+
* Enable `*[TERM]: expansion` and config-term rewriting.
|
|
345
|
+
*
|
|
346
|
+
* Default: `false`.
|
|
347
|
+
*/
|
|
348
|
+
enabled?: boolean
|
|
349
|
+
/**
|
|
350
|
+
* Central glossary terms. Keys are matched with Unicode word boundaries.
|
|
351
|
+
*
|
|
352
|
+
* Default: `{}`.
|
|
353
|
+
*/
|
|
354
|
+
terms?: Record<string, string>
|
|
355
|
+
/**
|
|
356
|
+
* Wrap only the first occurrence of each term.
|
|
357
|
+
*
|
|
358
|
+
* Default: `false` (every occurrence).
|
|
359
|
+
*/
|
|
360
|
+
firstUseOnly?: boolean
|
|
361
|
+
}
|
|
362
|
+
|
|
335
363
|
/** Attribute syntax transform options. */
|
|
336
364
|
export interface JsAttrsOptions {
|
|
337
365
|
/**
|
|
@@ -424,6 +452,16 @@ export interface JsCodeBlockLintOptions {
|
|
|
424
452
|
trailingSpaces?: boolean
|
|
425
453
|
}
|
|
426
454
|
|
|
455
|
+
/** Opt-in `::: code-group` fence groups. */
|
|
456
|
+
export interface JsCodeGroupOptions {
|
|
457
|
+
/**
|
|
458
|
+
* Enable VitePress-style `::: code-group` rewriting.
|
|
459
|
+
*
|
|
460
|
+
* Default: `false`.
|
|
461
|
+
*/
|
|
462
|
+
enabled?: boolean
|
|
463
|
+
}
|
|
464
|
+
|
|
427
465
|
/** Code import / snippet injection options. */
|
|
428
466
|
export interface JsCodeImportOptions {
|
|
429
467
|
/**
|
|
@@ -469,6 +507,38 @@ export interface JsContainerTypeOptions {
|
|
|
469
507
|
tag?: string
|
|
470
508
|
}
|
|
471
509
|
|
|
510
|
+
/** Opt-in static `csv-table` / `json-table` fences. */
|
|
511
|
+
export interface JsDataTableOptions {
|
|
512
|
+
/**
|
|
513
|
+
* Enable `csv-table` and `json-table` fences.
|
|
514
|
+
*
|
|
515
|
+
* Default: `false`.
|
|
516
|
+
*/
|
|
517
|
+
enabled?: boolean
|
|
518
|
+
/**
|
|
519
|
+
* Root directory used for `@/` and absolute data-table imports.
|
|
520
|
+
*
|
|
521
|
+
* Default: project root from the JavaScript caller.
|
|
522
|
+
*/
|
|
523
|
+
rootDir?: string
|
|
524
|
+
/**
|
|
525
|
+
* What to do when an imported file is missing.
|
|
526
|
+
*
|
|
527
|
+
* Default: `"error"`.
|
|
528
|
+
*/
|
|
529
|
+
missing?: string
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/** Opt-in PHP Markdown Extra / mdBook-style definition lists. */
|
|
533
|
+
export interface JsDefinitionListOptions {
|
|
534
|
+
/**
|
|
535
|
+
* Enable `Term` / `: definition` expansion.
|
|
536
|
+
*
|
|
537
|
+
* Default: `false`.
|
|
538
|
+
*/
|
|
539
|
+
enabled?: boolean
|
|
540
|
+
}
|
|
541
|
+
|
|
472
542
|
/** Normalized documentation entry used by generated API docs. */
|
|
473
543
|
export interface JsDocEntry {
|
|
474
544
|
name: string
|
|
@@ -872,6 +942,26 @@ export interface JsFileTreeOptions {
|
|
|
872
942
|
* Default: `false`.
|
|
873
943
|
*/
|
|
874
944
|
enabled?: boolean
|
|
945
|
+
/**
|
|
946
|
+
* Open directory `<details>` by default.
|
|
947
|
+
*
|
|
948
|
+
* Default: `true`.
|
|
949
|
+
*/
|
|
950
|
+
defaultOpen?: boolean
|
|
951
|
+
/**
|
|
952
|
+
* Render folder and file icons.
|
|
953
|
+
*
|
|
954
|
+
* Default: `true`.
|
|
955
|
+
*/
|
|
956
|
+
icons?: boolean
|
|
957
|
+
/** Trusted SVG markup or class tokens for collapsed folders. */
|
|
958
|
+
iconFolder?: string
|
|
959
|
+
/** Trusted SVG markup or class tokens for open folders. */
|
|
960
|
+
iconFolderOpen?: string
|
|
961
|
+
/** Trusted SVG markup or class tokens for files. */
|
|
962
|
+
iconFile?: string
|
|
963
|
+
/** Trusted SVG markup or class tokens keyed by file extension. */
|
|
964
|
+
iconFiles?: Record<string, string>
|
|
875
965
|
}
|
|
876
966
|
|
|
877
967
|
export interface JsFrameworkComponentIsland {
|
|
@@ -881,6 +971,22 @@ export interface JsFrameworkComponentIsland {
|
|
|
881
971
|
content?: string
|
|
882
972
|
}
|
|
883
973
|
|
|
974
|
+
/** Generated OpenAPI Markdown pages and navigation metadata. */
|
|
975
|
+
export interface JsGeneratedOpenApiDocs {
|
|
976
|
+
pages: Record<string, string>
|
|
977
|
+
nav: Array<JsDocsNavItem>
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
/** One unique git author returned by `getGitContributors`. */
|
|
981
|
+
export interface JsGitContributor {
|
|
982
|
+
/** Author name from `%an`. */
|
|
983
|
+
name: string
|
|
984
|
+
/** Author email from `%ae`. Never rendered into `href`. */
|
|
985
|
+
email?: string
|
|
986
|
+
/** Number of commits attributed to this author on the file. */
|
|
987
|
+
commits?: number
|
|
988
|
+
}
|
|
989
|
+
|
|
884
990
|
/** Export graph resolution options. */
|
|
885
991
|
export interface JsGraphOptions {
|
|
886
992
|
root?: string
|
|
@@ -889,6 +995,12 @@ export interface JsGraphOptions {
|
|
|
889
995
|
externalPackageSources?: Array<JsExternalPackageSource>
|
|
890
996
|
}
|
|
891
997
|
|
|
998
|
+
/** One page-head validation finding. */
|
|
999
|
+
export interface JsHeadDiagnostic {
|
|
1000
|
+
strict: boolean
|
|
1001
|
+
message: string
|
|
1002
|
+
}
|
|
1003
|
+
|
|
892
1004
|
/** Header nav link or dropdown. */
|
|
893
1005
|
export interface JsHeaderNavItem {
|
|
894
1006
|
/** Display label. */
|
|
@@ -987,6 +1099,34 @@ export interface JsI18NRuntimeLocale {
|
|
|
987
1099
|
dir?: string
|
|
988
1100
|
}
|
|
989
1101
|
|
|
1102
|
+
/** Opt-in static `::: gallery` image groups. */
|
|
1103
|
+
export interface JsImageGalleryOptions {
|
|
1104
|
+
/**
|
|
1105
|
+
* Enable static image gallery blocks.
|
|
1106
|
+
*
|
|
1107
|
+
* Default: `false`.
|
|
1108
|
+
*/
|
|
1109
|
+
enabled?: boolean
|
|
1110
|
+
/**
|
|
1111
|
+
* Add `loading="lazy"` to images inside galleries.
|
|
1112
|
+
*
|
|
1113
|
+
* Default: follows `images.lazy`, or `true` when `images` is disabled.
|
|
1114
|
+
*/
|
|
1115
|
+
lazy?: boolean
|
|
1116
|
+
/**
|
|
1117
|
+
* Validation mode for images with empty alt text.
|
|
1118
|
+
*
|
|
1119
|
+
* Default: `"error"`.
|
|
1120
|
+
*/
|
|
1121
|
+
missingAlt?: string
|
|
1122
|
+
/**
|
|
1123
|
+
* Validation mode for galleries without image items.
|
|
1124
|
+
*
|
|
1125
|
+
* Default: `"error"`.
|
|
1126
|
+
*/
|
|
1127
|
+
empty?: string
|
|
1128
|
+
}
|
|
1129
|
+
|
|
990
1130
|
/** Opt-in figures, captions, and lazy images. */
|
|
991
1131
|
export interface JsImageOptions {
|
|
992
1132
|
/**
|
|
@@ -1039,6 +1179,48 @@ export interface JsIncrementalRenderOptions {
|
|
|
1039
1179
|
completeInline?: boolean
|
|
1040
1180
|
}
|
|
1041
1181
|
|
|
1182
|
+
/** Opt-in JSON-LD structured data. Presence of the object enables the feature. */
|
|
1183
|
+
export interface JsJsonLd {
|
|
1184
|
+
/** When false, omit BreadcrumbList even if a visible trail exists. */
|
|
1185
|
+
breadcrumbs?: boolean
|
|
1186
|
+
/** Optional publisher. Missing fields are not invented. */
|
|
1187
|
+
publisher?: JsJsonLdPublisher
|
|
1188
|
+
/** Site origin used for `@id` / `url`. */
|
|
1189
|
+
siteUrl?: string
|
|
1190
|
+
pageType?: string
|
|
1191
|
+
graph?: Array<string>
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
/** Optional JSON-LD publisher. Only configured fields are emitted. */
|
|
1195
|
+
export interface JsJsonLdPublisher {
|
|
1196
|
+
/** Organization name. */
|
|
1197
|
+
name?: string
|
|
1198
|
+
/** Organization URL. Unsafe schemes are dropped. */
|
|
1199
|
+
url?: string
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/** Opt-in `{kbd:...}` inline keyboard keys. */
|
|
1203
|
+
export interface JsKeyboardKeysOptions {
|
|
1204
|
+
/**
|
|
1205
|
+
* Enable `{kbd:Ctrl+K}` expansion.
|
|
1206
|
+
*
|
|
1207
|
+
* Default: `false`.
|
|
1208
|
+
*/
|
|
1209
|
+
enabled?: boolean
|
|
1210
|
+
/**
|
|
1211
|
+
* Build-time key aliases. Keys are matched case-insensitively.
|
|
1212
|
+
*
|
|
1213
|
+
* Default: `{}`.
|
|
1214
|
+
*/
|
|
1215
|
+
aliases?: Record<string, string>
|
|
1216
|
+
/**
|
|
1217
|
+
* Label style for built-in aliases: `"words"` or `"symbols"`.
|
|
1218
|
+
*
|
|
1219
|
+
* Default: `"words"`.
|
|
1220
|
+
*/
|
|
1221
|
+
style?: string
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1042
1224
|
/** Locale information for the locale switcher. */
|
|
1043
1225
|
export interface JsLocaleInfo {
|
|
1044
1226
|
/** BCP 47 locale tag. */
|
|
@@ -1059,6 +1241,52 @@ export interface JsLocalePath {
|
|
|
1059
1241
|
root?: string
|
|
1060
1242
|
}
|
|
1061
1243
|
|
|
1244
|
+
/** One configured magic-link alias. */
|
|
1245
|
+
export interface JsMagicLinkAlias {
|
|
1246
|
+
/** Absolute `http:` / `https:` URL. */
|
|
1247
|
+
href: string
|
|
1248
|
+
/** Optional display label. Defaults to the alias key. */
|
|
1249
|
+
label?: string
|
|
1250
|
+
/** Optional avatar or favicon URL. */
|
|
1251
|
+
image?: string
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/** Replace the resolved image for matching hrefs. */
|
|
1255
|
+
export interface JsMagicLinkImageOverride {
|
|
1256
|
+
/** Exact href to replace. */
|
|
1257
|
+
href?: string
|
|
1258
|
+
/** Href prefix to replace. */
|
|
1259
|
+
prefix?: string
|
|
1260
|
+
/** Replacement image URL. Must be `http:` or `https:`. */
|
|
1261
|
+
image: string
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
/** Opt-in `{link:...}` rich magic links. */
|
|
1265
|
+
export interface JsMagicLinkOptions {
|
|
1266
|
+
/**
|
|
1267
|
+
* Enable `{link:@user}`, `{link:alias}`, and `{link:label|url}`.
|
|
1268
|
+
*
|
|
1269
|
+
* Default: `false`.
|
|
1270
|
+
*/
|
|
1271
|
+
enabled?: boolean
|
|
1272
|
+
/** Named aliases mapped to href / label / image. */
|
|
1273
|
+
aliases?: Record<string, JsMagicLinkAlias>
|
|
1274
|
+
/**
|
|
1275
|
+
* Emit a favicon URL for explicit links that have no image.
|
|
1276
|
+
*
|
|
1277
|
+
* Default: `false`. No transform-time network request.
|
|
1278
|
+
*/
|
|
1279
|
+
favicon?: boolean
|
|
1280
|
+
/**
|
|
1281
|
+
* Favicon URL template with a `{host}` placeholder.
|
|
1282
|
+
*
|
|
1283
|
+
* Default: `https://{host}/favicon.ico` when `favicon` is true.
|
|
1284
|
+
*/
|
|
1285
|
+
faviconTemplate?: string
|
|
1286
|
+
/** Image replacements applied after alias / GitHub / favicon resolution. */
|
|
1287
|
+
imageOverrides?: Array<JsMagicLinkImageOverride>
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1062
1290
|
export interface JsMarkdownLintDiagnostic {
|
|
1063
1291
|
ruleId: string
|
|
1064
1292
|
severity: string
|
|
@@ -1126,6 +1354,18 @@ export interface JsMediaEmbedsOptions {
|
|
|
1126
1354
|
* Default: `false`.
|
|
1127
1355
|
*/
|
|
1128
1356
|
spotify?: boolean
|
|
1357
|
+
/**
|
|
1358
|
+
* Render `<AppleMusic>` embeds.
|
|
1359
|
+
*
|
|
1360
|
+
* Default: `false`.
|
|
1361
|
+
*/
|
|
1362
|
+
appleMusic?: boolean
|
|
1363
|
+
/**
|
|
1364
|
+
* Render `<SpeakerDeck>` embeds.
|
|
1365
|
+
*
|
|
1366
|
+
* Default: `false`.
|
|
1367
|
+
*/
|
|
1368
|
+
speakerDeck?: boolean
|
|
1129
1369
|
/**
|
|
1130
1370
|
* Render `<StackBlitz>` embeds.
|
|
1131
1371
|
*
|
|
@@ -1150,6 +1390,40 @@ export interface JsMediaEmbedsOptions {
|
|
|
1150
1390
|
* Default: `false`.
|
|
1151
1391
|
*/
|
|
1152
1392
|
webContainer?: boolean
|
|
1393
|
+
/**
|
|
1394
|
+
* Render `<Audio>` native players.
|
|
1395
|
+
*
|
|
1396
|
+
* Default: `false`.
|
|
1397
|
+
*/
|
|
1398
|
+
audio?: boolean
|
|
1399
|
+
/**
|
|
1400
|
+
* Render `<Video>` native players.
|
|
1401
|
+
*
|
|
1402
|
+
* Default: `false`.
|
|
1403
|
+
*/
|
|
1404
|
+
video?: boolean
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/** Opt-in `<NotByAI />` authorship badge. */
|
|
1408
|
+
export interface JsNotByAiOptions {
|
|
1409
|
+
/**
|
|
1410
|
+
* Enable `<NotByAI />` expansion.
|
|
1411
|
+
*
|
|
1412
|
+
* Default: `false`.
|
|
1413
|
+
*/
|
|
1414
|
+
enabled?: boolean
|
|
1415
|
+
/**
|
|
1416
|
+
* Accessible label for the badge link.
|
|
1417
|
+
*
|
|
1418
|
+
* Default: `"Written by human, not by AI"`.
|
|
1419
|
+
*/
|
|
1420
|
+
label?: string
|
|
1421
|
+
/**
|
|
1422
|
+
* Destination URL. Unsafe values fall back to `https://notbyai.fyi`.
|
|
1423
|
+
*
|
|
1424
|
+
* Default: `"https://notbyai.fyi"`.
|
|
1425
|
+
*/
|
|
1426
|
+
href?: string
|
|
1153
1427
|
}
|
|
1154
1428
|
|
|
1155
1429
|
/** OG image configuration for JavaScript. */
|
|
@@ -1180,6 +1454,19 @@ export interface JsOgImageData {
|
|
|
1180
1454
|
author?: string
|
|
1181
1455
|
}
|
|
1182
1456
|
|
|
1457
|
+
/** One local OpenAPI file consumed by the generated docs pipeline. */
|
|
1458
|
+
export interface JsOpenApiDocsInput {
|
|
1459
|
+
path: string
|
|
1460
|
+
name?: string
|
|
1461
|
+
failOnUnresolvedRefs?: boolean
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
/** Options shared by all OpenAPI docs inputs. */
|
|
1465
|
+
export interface JsOpenApiDocsOptions {
|
|
1466
|
+
root?: string
|
|
1467
|
+
basePath?: string
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1183
1470
|
/** Per-page frontmatter chrome flags. */
|
|
1184
1471
|
export interface JsPageChromeFlags {
|
|
1185
1472
|
sidebar?: boolean
|
|
@@ -1251,6 +1538,34 @@ export interface JsParserOptions {
|
|
|
1251
1538
|
autolinks?: boolean
|
|
1252
1539
|
}
|
|
1253
1540
|
|
|
1541
|
+
/** Opt-in parameterized Markdown partials. */
|
|
1542
|
+
export interface JsPartialsOptions {
|
|
1543
|
+
/**
|
|
1544
|
+
* Enable `<!-- @partial: PATH k="v" -->` expansion.
|
|
1545
|
+
*
|
|
1546
|
+
* Default: `false`.
|
|
1547
|
+
*/
|
|
1548
|
+
enabled?: boolean
|
|
1549
|
+
/**
|
|
1550
|
+
* Root directory used for `@/` and absolute partial paths.
|
|
1551
|
+
*
|
|
1552
|
+
* Default: project root from the JavaScript caller.
|
|
1553
|
+
*/
|
|
1554
|
+
rootDir?: string
|
|
1555
|
+
/**
|
|
1556
|
+
* Directory used for bare partial names such as `install.md`.
|
|
1557
|
+
*
|
|
1558
|
+
* Default: `"_partials"`.
|
|
1559
|
+
*/
|
|
1560
|
+
root?: string
|
|
1561
|
+
/**
|
|
1562
|
+
* Missing `{{ name }}` substitutions: `"literal"` (default) or `"error"`.
|
|
1563
|
+
*
|
|
1564
|
+
* Default: `"literal"`.
|
|
1565
|
+
*/
|
|
1566
|
+
missing?: string
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1254
1569
|
/** A block the native pass left for the caller's highlighter. */
|
|
1255
1570
|
export interface JsPendingBlock {
|
|
1256
1571
|
/** The `language-…` class the block carries. */
|
|
@@ -1419,12 +1734,24 @@ export interface JsSearchRuntimeOptions {
|
|
|
1419
1734
|
limit: number
|
|
1420
1735
|
/** Enable prefix matching. */
|
|
1421
1736
|
prefix: boolean
|
|
1737
|
+
/** Enable fuzzy typo-tolerant matching. */
|
|
1738
|
+
fuzzy: boolean
|
|
1422
1739
|
/** Search input placeholder. */
|
|
1423
1740
|
placeholder: string
|
|
1424
1741
|
/** Keyboard shortcut to focus search. */
|
|
1425
1742
|
hotkey: string
|
|
1426
1743
|
}
|
|
1427
1744
|
|
|
1745
|
+
/** One child link on a generated section index. */
|
|
1746
|
+
export interface JsSectionIndexItem {
|
|
1747
|
+
/** Visible title. Escaped in HTML. */
|
|
1748
|
+
title: string
|
|
1749
|
+
/** Destination. `javascript:` and other schemes are rejected. */
|
|
1750
|
+
href: string
|
|
1751
|
+
/** Optional card description. Escaped in HTML. */
|
|
1752
|
+
description?: string
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1428
1755
|
/** Custom social link for JavaScript. */
|
|
1429
1756
|
export interface JsSocialLink {
|
|
1430
1757
|
/** Icon label. */
|
|
@@ -1539,14 +1866,12 @@ export interface JsSsgBarePage {
|
|
|
1539
1866
|
|
|
1540
1867
|
/** SSG configuration. */
|
|
1541
1868
|
export interface JsSsgConfig {
|
|
1542
|
-
/** Site name. */
|
|
1543
1869
|
siteName: string
|
|
1544
|
-
/** Base URL path. */
|
|
1545
1870
|
base: string
|
|
1546
|
-
/** Optional site-root href for breadcrumbs. */
|
|
1547
1871
|
breadcrumbRootHref?: string
|
|
1548
|
-
/** OG image URL. */
|
|
1549
1872
|
ogImage?: string
|
|
1873
|
+
siteUrl?: string
|
|
1874
|
+
headValidation?: string
|
|
1550
1875
|
/** Theme configuration. */
|
|
1551
1876
|
theme?: JsThemeConfig
|
|
1552
1877
|
/** Current locale for this page. */
|
|
@@ -1569,6 +1894,16 @@ export interface JsSsgConfig {
|
|
|
1569
1894
|
team?: JsTeamOptions
|
|
1570
1895
|
/** When true, honor per-page frontmatter chrome flags. */
|
|
1571
1896
|
pageChrome?: boolean
|
|
1897
|
+
/** Opt-in JSON-LD structured data. Presence enables the feature. */
|
|
1898
|
+
jsonLd?: JsJsonLd
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
/** One rendered git author on an SSG page. */
|
|
1902
|
+
export interface JsSsgContributor {
|
|
1903
|
+
/** Display name. Escaped in HTML. */
|
|
1904
|
+
name: string
|
|
1905
|
+
/** Optional `https:` avatar URL. Emails are never accepted here. */
|
|
1906
|
+
avatar?: string
|
|
1572
1907
|
}
|
|
1573
1908
|
|
|
1574
1909
|
/** Result of SSG shared asset extraction. */
|
|
@@ -1589,6 +1924,12 @@ export interface JsSsgGeneratedHtmlPage {
|
|
|
1589
1924
|
html: string
|
|
1590
1925
|
}
|
|
1591
1926
|
|
|
1927
|
+
/** Themed SSG HTML plus page-head diagnostics. */
|
|
1928
|
+
export interface JsSsgHtmlResult {
|
|
1929
|
+
html: string
|
|
1930
|
+
diagnostics: Array<JsHeadDiagnostic>
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1592
1933
|
/** Navigation group for SSG. */
|
|
1593
1934
|
export interface JsSsgNavGroup {
|
|
1594
1935
|
/** Group title. */
|
|
@@ -1637,6 +1978,8 @@ export interface JsSsgPageData {
|
|
|
1637
1978
|
toc: Array<TocEntry>
|
|
1638
1979
|
/** Last updated timestamp in milliseconds since the Unix epoch. */
|
|
1639
1980
|
lastUpdated?: number
|
|
1981
|
+
/** Unique git authors for this page. Empty unless the site opted in. */
|
|
1982
|
+
contributors?: Array<JsSsgContributor>
|
|
1640
1983
|
/** URL path. */
|
|
1641
1984
|
path: string
|
|
1642
1985
|
/** Entry page configuration (if layout: entry). */
|
|
@@ -1651,6 +1994,12 @@ export interface JsSsgPageData {
|
|
|
1651
1994
|
layout?: string
|
|
1652
1995
|
/** Per-page chrome flags. Honored only when page chrome is enabled. */
|
|
1653
1996
|
chrome?: JsPageChromeFlags
|
|
1997
|
+
/** Frontmatter `robots`. */
|
|
1998
|
+
robots?: string
|
|
1999
|
+
/** Frontmatter `canonical`. */
|
|
2000
|
+
canonical?: string
|
|
2001
|
+
/** Companion `.md` URL when copy-as-markdown chrome is on. */
|
|
2002
|
+
markdownSource?: string
|
|
1654
2003
|
}
|
|
1655
2004
|
|
|
1656
2005
|
/** Resolved SSG output and public route paths. */
|
|
@@ -1777,15 +2126,15 @@ export interface JsThemeConfig {
|
|
|
1777
2126
|
aside?: boolean
|
|
1778
2127
|
/** Breadcrumb trail from the site root through sidebar ancestors. */
|
|
1779
2128
|
breadcrumbs?: boolean
|
|
2129
|
+
/** Heading permalink visibility. `"hover"` or `"always"`. CSS only. */
|
|
2130
|
+
headingPermalink?: string
|
|
1780
2131
|
/** Light mode colors. */
|
|
1781
2132
|
colors?: JsThemeColors
|
|
1782
2133
|
/** Dark mode colors. */
|
|
1783
2134
|
darkColors?: JsThemeColors
|
|
1784
|
-
/** Font configuration. */
|
|
1785
2135
|
fonts?: JsThemeFonts
|
|
1786
2136
|
/** Entry page configuration. */
|
|
1787
2137
|
entryPage?: JsThemeEntryPage
|
|
1788
|
-
/** Layout configuration. */
|
|
1789
2138
|
layout?: JsThemeLayout
|
|
1790
2139
|
/** Header configuration. */
|
|
1791
2140
|
header?: JsThemeHeader
|
|
@@ -1875,6 +2224,40 @@ export interface JsThemeLayout {
|
|
|
1875
2224
|
maxContentWidth?: string
|
|
1876
2225
|
}
|
|
1877
2226
|
|
|
2227
|
+
/** Opt-in static `::: timeline` milestone lists. */
|
|
2228
|
+
export interface JsTimelineOptions {
|
|
2229
|
+
/**
|
|
2230
|
+
* Enable static timeline blocks.
|
|
2231
|
+
*
|
|
2232
|
+
* Default: `false`.
|
|
2233
|
+
*/
|
|
2234
|
+
enabled?: boolean
|
|
2235
|
+
/**
|
|
2236
|
+
* Render timelines as ordered lists unless a block overrides it.
|
|
2237
|
+
*
|
|
2238
|
+
* Default: `true`.
|
|
2239
|
+
*/
|
|
2240
|
+
ordered?: boolean
|
|
2241
|
+
/**
|
|
2242
|
+
* Validation mode for malformed dates.
|
|
2243
|
+
*
|
|
2244
|
+
* Default: `"error"`.
|
|
2245
|
+
*/
|
|
2246
|
+
invalidDate?: string
|
|
2247
|
+
/**
|
|
2248
|
+
* Validation mode for unsupported item metadata.
|
|
2249
|
+
*
|
|
2250
|
+
* Default: `"error"`.
|
|
2251
|
+
*/
|
|
2252
|
+
unknownMeta?: string
|
|
2253
|
+
/**
|
|
2254
|
+
* Validation mode for timeline blocks without items.
|
|
2255
|
+
*
|
|
2256
|
+
* Default: `"error"`.
|
|
2257
|
+
*/
|
|
2258
|
+
empty?: string
|
|
2259
|
+
}
|
|
2260
|
+
|
|
1878
2261
|
/**
|
|
1879
2262
|
* Transform options for JavaScript.
|
|
1880
2263
|
*
|
|
@@ -1900,6 +2283,12 @@ export interface JsTransformOptions {
|
|
|
1900
2283
|
* Default: `false`, or `true` when `gfm` is `true`.
|
|
1901
2284
|
*/
|
|
1902
2285
|
footnotes?: boolean
|
|
2286
|
+
/**
|
|
2287
|
+
* Render footnotes as a semantic ordered section with numeric markers.
|
|
2288
|
+
*
|
|
2289
|
+
* Default: `false`.
|
|
2290
|
+
*/
|
|
2291
|
+
semanticFootnotes?: boolean
|
|
1903
2292
|
/**
|
|
1904
2293
|
* Enable GFM task-list item markers.
|
|
1905
2294
|
*
|
|
@@ -1999,6 +2388,12 @@ export interface JsTransformOptions {
|
|
|
1999
2388
|
* Default: `true`; ignored when [`Self::autolink_urls`] is off.
|
|
2000
2389
|
*/
|
|
2001
2390
|
autolinkTargetBlank?: boolean
|
|
2391
|
+
/**
|
|
2392
|
+
* Opt-in visible heading permalinks (`<a class="header-anchor" href="#id">`).
|
|
2393
|
+
*
|
|
2394
|
+
* Default: disabled. Existing HTML stays unchanged until this is enabled.
|
|
2395
|
+
*/
|
|
2396
|
+
headingPermalinks?: boolean
|
|
2002
2397
|
/**
|
|
2003
2398
|
* Opt-in Obsidian-style wiki links.
|
|
2004
2399
|
*
|
|
@@ -2067,24 +2462,78 @@ export interface JsTransformOptions {
|
|
|
2067
2462
|
* Default: disabled.
|
|
2068
2463
|
*/
|
|
2069
2464
|
includes?: JsIncludeOptions
|
|
2465
|
+
/**
|
|
2466
|
+
* Opt-in parameterized Markdown partials via `<!-- @partial: PATH k="v" -->`.
|
|
2467
|
+
*
|
|
2468
|
+
* Default: disabled.
|
|
2469
|
+
*/
|
|
2470
|
+
partials?: JsPartialsOptions
|
|
2070
2471
|
/**
|
|
2071
2472
|
* Opt-in `::: steps` ordered lists.
|
|
2072
2473
|
*
|
|
2073
2474
|
* Default: disabled.
|
|
2074
2475
|
*/
|
|
2075
2476
|
steps?: JsStepsOptions
|
|
2477
|
+
/**
|
|
2478
|
+
* Opt-in `::: code-group` fence groups.
|
|
2479
|
+
*
|
|
2480
|
+
* Default: disabled.
|
|
2481
|
+
*/
|
|
2482
|
+
codeGroups?: JsCodeGroupOptions
|
|
2076
2483
|
/**
|
|
2077
2484
|
* Opt-in `{badge:variant}` inline badges.
|
|
2078
2485
|
*
|
|
2079
2486
|
* Default: disabled.
|
|
2080
2487
|
*/
|
|
2081
2488
|
badges?: JsBadgeOptions
|
|
2489
|
+
/**
|
|
2490
|
+
* Opt-in `<NotByAI />` authorship badge.
|
|
2491
|
+
*
|
|
2492
|
+
* Default: disabled.
|
|
2493
|
+
*/
|
|
2494
|
+
notByAi?: JsNotByAiOptions
|
|
2495
|
+
/**
|
|
2496
|
+
* Opt-in `{kbd:...}` inline keyboard keys.
|
|
2497
|
+
*
|
|
2498
|
+
* Default: disabled.
|
|
2499
|
+
*/
|
|
2500
|
+
keyboardKeys?: JsKeyboardKeysOptions
|
|
2501
|
+
/**
|
|
2502
|
+
* Opt-in abbreviation and glossary expansion.
|
|
2503
|
+
*
|
|
2504
|
+
* Default: disabled.
|
|
2505
|
+
*/
|
|
2506
|
+
abbreviations?: JsAbbreviationsOptions
|
|
2507
|
+
/**
|
|
2508
|
+
* Opt-in PHP Markdown Extra / mdBook-style definition lists.
|
|
2509
|
+
*
|
|
2510
|
+
* Default: disabled.
|
|
2511
|
+
*/
|
|
2512
|
+
definitionLists?: JsDefinitionListOptions
|
|
2513
|
+
/**
|
|
2514
|
+
* Opt-in `{link:...}` rich magic links.
|
|
2515
|
+
*
|
|
2516
|
+
* Default: disabled.
|
|
2517
|
+
*/
|
|
2518
|
+
magicLinks?: JsMagicLinkOptions
|
|
2082
2519
|
/**
|
|
2083
2520
|
* Opt-in figures, captions, and lazy images.
|
|
2084
2521
|
*
|
|
2085
2522
|
* Default: disabled.
|
|
2086
2523
|
*/
|
|
2087
2524
|
images?: JsImageOptions
|
|
2525
|
+
/**
|
|
2526
|
+
* Opt-in static `::: gallery` image groups.
|
|
2527
|
+
*
|
|
2528
|
+
* Default: disabled.
|
|
2529
|
+
*/
|
|
2530
|
+
imageGalleries?: JsImageGalleryOptions
|
|
2531
|
+
/**
|
|
2532
|
+
* Opt-in static `::: timeline` milestone lists.
|
|
2533
|
+
*
|
|
2534
|
+
* Default: disabled.
|
|
2535
|
+
*/
|
|
2536
|
+
timelines?: JsTimelineOptions
|
|
2088
2537
|
/**
|
|
2089
2538
|
* Opt-in `::: card` / `::: link-card` / `::: card-grid` blocks.
|
|
2090
2539
|
*
|
|
@@ -2103,6 +2552,12 @@ export interface JsTransformOptions {
|
|
|
2103
2552
|
* Default: disabled.
|
|
2104
2553
|
*/
|
|
2105
2554
|
fileTree?: JsFileTreeOptions
|
|
2555
|
+
/**
|
|
2556
|
+
* Opt-in static `csv-table` / `json-table` fences.
|
|
2557
|
+
*
|
|
2558
|
+
* Default: disabled.
|
|
2559
|
+
*/
|
|
2560
|
+
dataTables?: JsDataTableOptions
|
|
2106
2561
|
}
|
|
2107
2562
|
|
|
2108
2563
|
/** Type parameter documentation (`<T extends C = D>`) used by generated API docs. */
|
|
@@ -2186,6 +2641,24 @@ export declare function loadDictionariesFlat(dir: string): Record<string, Record
|
|
|
2186
2641
|
/** Returns true when a document belongs to at least one requested search scope. */
|
|
2187
2642
|
export declare function matchesSearchScopes(id: string, url: string, scopes: Array<string>): boolean
|
|
2188
2643
|
|
|
2644
|
+
/** One `import` statement collected from MDX ESM. */
|
|
2645
|
+
export interface MdxImport {
|
|
2646
|
+
/** Module specifier string. */
|
|
2647
|
+
source: string
|
|
2648
|
+
/** Bindings created by the import. */
|
|
2649
|
+
specifiers: Array<MdxImportSpecifier>
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
/** How a specifier was imported. */
|
|
2653
|
+
export interface MdxImportSpecifier {
|
|
2654
|
+
/** Imported name (`default`, `*`, or the named export). */
|
|
2655
|
+
imported: string
|
|
2656
|
+
/** Local binding name. */
|
|
2657
|
+
local: string
|
|
2658
|
+
/** `default`, `named`, or `namespace`. */
|
|
2659
|
+
kind: 'default' | 'named' | 'namespace'
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2189
2662
|
/** Restores code block metadata after JavaScript-side syntax highlighting. */
|
|
2190
2663
|
export declare function mergeHighlightedCodeBlocks(originalHtml: string, highlightedHtml: string): string
|
|
2191
2664
|
|
|
@@ -2280,6 +2753,9 @@ export declare function render(astJson: string): RenderResult
|
|
|
2280
2753
|
*/
|
|
2281
2754
|
export declare function renderFrameworkComponentCode(html: string, target: string, islands?: Array<JsFrameworkComponentIsland> | undefined | null, mode?: string | undefined | null): string
|
|
2282
2755
|
|
|
2756
|
+
/** Resolve Unhead-compatible page-head descriptors to HTML. */
|
|
2757
|
+
export declare function renderHead(inputJson: string): JsSsgHtmlResult
|
|
2758
|
+
|
|
2283
2759
|
/** Render result containing the HTML output. */
|
|
2284
2760
|
export interface RenderResult {
|
|
2285
2761
|
/** The rendered HTML. */
|
|
@@ -2288,6 +2764,9 @@ export interface RenderResult {
|
|
|
2288
2764
|
errors: Array<string>
|
|
2289
2765
|
}
|
|
2290
2766
|
|
|
2767
|
+
/** Renders escaped section-index listing HTML. Hostile hrefs are dropped. */
|
|
2768
|
+
export declare function renderSsgSectionIndex(title: string, items: Array<JsSectionIndexItem>, style: string): string
|
|
2769
|
+
|
|
2291
2770
|
/** Resolves manual SSG navigation groups. */
|
|
2292
2771
|
export declare function resolveSsgNavigationGroups(navigation: Array<JsSsgNavigationGroup>, base: string, extension: string): Array<JsSsgNavGroup>
|
|
2293
2772
|
|
|
@@ -2354,7 +2833,7 @@ export declare function transformMermaid(html: string, mmdcPath: string): Mermai
|
|
|
2354
2833
|
*/
|
|
2355
2834
|
export declare function transformPmEmbeds(html: string, startGroup: number, options?: JsPmOptions | undefined | null): JsPmTransformResult
|
|
2356
2835
|
|
|
2357
|
-
/** Transform result containing HTML, frontmatter, and
|
|
2836
|
+
/** Transform result containing HTML, frontmatter, TOC, and MDX metadata. */
|
|
2358
2837
|
export interface TransformResult {
|
|
2359
2838
|
/** The rendered HTML. */
|
|
2360
2839
|
html: string
|
|
@@ -2364,6 +2843,12 @@ export interface TransformResult {
|
|
|
2364
2843
|
toc: Array<TocEntry>
|
|
2365
2844
|
/** Parse/render errors, if any. */
|
|
2366
2845
|
errors: Array<string>
|
|
2846
|
+
/** MDX `import` statements (empty when MDX is off or no ESM nodes). */
|
|
2847
|
+
imports: Array<MdxImport>
|
|
2848
|
+
/** Export names from MDX ESM (empty when MDX is off or no exports). */
|
|
2849
|
+
exports: Array<string>
|
|
2850
|
+
/** Unique JSX component names in document order (empty when none). */
|
|
2851
|
+
components: Array<string>
|
|
2367
2852
|
}
|
|
2368
2853
|
|
|
2369
2854
|
/**
|
package/index.js
CHANGED
|
@@ -191,6 +191,7 @@ module.exports.generateDocsNavCode = binding.generateDocsNavCode;
|
|
|
191
191
|
module.exports.collectDocsSourceFiles = binding.collectDocsSourceFiles;
|
|
192
192
|
module.exports.generateDocsDataJson = binding.generateDocsDataJson;
|
|
193
193
|
module.exports.generateDocsMarkdown = binding.generateDocsMarkdown;
|
|
194
|
+
module.exports.generateOpenApiDocs = binding.generateOpenApiDocs;
|
|
194
195
|
module.exports.writeGeneratedDocs = binding.writeGeneratedDocs;
|
|
195
196
|
module.exports.buildCollectionManifest = binding.buildCollectionManifest;
|
|
196
197
|
module.exports.mergeHighlightedCodeBlocks = binding.mergeHighlightedCodeBlocks;
|
|
@@ -209,6 +210,7 @@ module.exports.generateSearchModuleFromOptions = binding.generateSearchModuleFro
|
|
|
209
210
|
module.exports.collectSearchMarkdownFiles = binding.collectSearchMarkdownFiles;
|
|
210
211
|
module.exports.normalizeVitePressFrontmatter = binding.normalizeVitePressFrontmatter;
|
|
211
212
|
module.exports.generateSsgHtml = binding.generateSsgHtml;
|
|
213
|
+
module.exports.renderHead = binding.renderHead;
|
|
212
214
|
module.exports.generateSsgBareHtml = binding.generateSsgBareHtml;
|
|
213
215
|
module.exports.highlightCodeBlock = binding.highlightCodeBlock;
|
|
214
216
|
module.exports.applyPendingHighlights = binding.applyPendingHighlights;
|
|
@@ -218,6 +220,7 @@ module.exports.supportsHighlightLanguage = binding.supportsHighlightLanguage;
|
|
|
218
220
|
module.exports.nativeHighlightLanguages = binding.nativeHighlightLanguages;
|
|
219
221
|
module.exports.generateSsgBarePage = binding.generateSsgBarePage;
|
|
220
222
|
module.exports.getGitLastUpdated = binding.getGitLastUpdated;
|
|
223
|
+
module.exports.getGitContributors = binding.getGitContributors;
|
|
221
224
|
module.exports.resolveSsgRoutePaths = binding.resolveSsgRoutePaths;
|
|
222
225
|
module.exports.getSsgOutputPath = binding.getSsgOutputPath;
|
|
223
226
|
module.exports.getSsgUrlPath = binding.getSsgUrlPath;
|
|
@@ -239,4 +242,5 @@ module.exports.checkI18n = binding.checkI18n;
|
|
|
239
242
|
module.exports.checkI18nProject = binding.checkI18nProject;
|
|
240
243
|
module.exports.extractTranslationKeys = binding.extractTranslationKeys;
|
|
241
244
|
module.exports.renderFrameworkComponentCode = binding.renderFrameworkComponentCode;
|
|
245
|
+
module.exports.renderSsgSectionIndex = binding.renderSsgSectionIndex;
|
|
242
246
|
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-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.10",
|
|
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-alpha.
|
|
51
|
-
"@ox-content/binding-darwin-arm64": "3.0.0-alpha.
|
|
52
|
-
"@ox-content/binding-linux-x64-gnu": "3.0.0-alpha.
|
|
53
|
-
"@ox-content/binding-linux-x64-musl": "3.0.0-alpha.
|
|
54
|
-
"@ox-content/binding-linux-arm64-gnu": "3.0.0-alpha.
|
|
55
|
-
"@ox-content/binding-linux-arm64-musl": "3.0.0-alpha.
|
|
56
|
-
"@ox-content/binding-win32-x64-msvc": "3.0.0-alpha.
|
|
50
|
+
"@ox-content/binding-darwin-x64": "3.0.0-alpha.10",
|
|
51
|
+
"@ox-content/binding-darwin-arm64": "3.0.0-alpha.10",
|
|
52
|
+
"@ox-content/binding-linux-x64-gnu": "3.0.0-alpha.10",
|
|
53
|
+
"@ox-content/binding-linux-x64-musl": "3.0.0-alpha.10",
|
|
54
|
+
"@ox-content/binding-linux-arm64-gnu": "3.0.0-alpha.10",
|
|
55
|
+
"@ox-content/binding-linux-arm64-musl": "3.0.0-alpha.10",
|
|
56
|
+
"@ox-content/binding-win32-x64-msvc": "3.0.0-alpha.10"
|
|
57
57
|
}
|
|
58
58
|
}
|