@ox-content/napi 2.89.0 → 3.0.0-alpha.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 +395 -1
- package/index.js +7 -0
- package/package.json +8 -8
package/index.d.ts
CHANGED
|
@@ -34,6 +34,17 @@ export declare class IncrementalMarkdownRenderer {
|
|
|
34
34
|
get pendingMarkdown(): string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Splices the caller's highlighting back over the blocks
|
|
39
|
+
* `highlightHtmlCodeBlocks` left pending.
|
|
40
|
+
*
|
|
41
|
+
* `replacements` lines up with the `pending` list it returned: entry `i` is a
|
|
42
|
+
* full `<pre>` element for pending block `i`, or an empty string to leave that
|
|
43
|
+
* block as it is. This keeps a page that needs one exotic grammar off the
|
|
44
|
+
* HTML round trip, instead of surrendering the whole document for it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function applyPendingHighlights(html: string, replacements: Array<string>): string
|
|
47
|
+
|
|
37
48
|
/**
|
|
38
49
|
* Builds a Markdown collection manifest directly from files on the Rust side.
|
|
39
50
|
*
|
|
@@ -59,7 +70,7 @@ export declare function buildSearchIndex(documents: Array<JsSearchDocument>): st
|
|
|
59
70
|
* File discovery, Markdown parsing, search document extraction, and index
|
|
60
71
|
* construction all run on the Rust side.
|
|
61
72
|
*/
|
|
62
|
-
export declare function buildSearchIndexFromDirectory(srcDir: string, base: string, extensions: Array<string
|
|
73
|
+
export declare function buildSearchIndexFromDirectory(srcDir: string, base: string, extensions: Array<string>, options?: JsSearchIndexBuildOptions | undefined | null): string
|
|
63
74
|
|
|
64
75
|
/** Builds SSG navigation groups from markdown files. */
|
|
65
76
|
export declare function buildSsgNavItems(markdownFiles: Array<string>, srcDir: string, base: string, extension: string): Array<JsSsgNavGroup>
|
|
@@ -85,6 +96,9 @@ export declare function checkI18n(dictDir: string, usedKeys: Array<string>): I18
|
|
|
85
96
|
*/
|
|
86
97
|
export declare function checkI18nProject(dictDir: string, srcDirs: Array<string>, functionNames: Array<string>, defaultLocale: string): I18NCheckResult
|
|
87
98
|
|
|
99
|
+
/** Classifies already-parsed frontmatter JSON against publish-state options. */
|
|
100
|
+
export declare function classifyPublishState(frontmatterJson: string, options?: JsPublishStateOptions | undefined | null): JsPublishDecision
|
|
101
|
+
|
|
88
102
|
/** Collects source files for generated API documentation. */
|
|
89
103
|
export declare function collectDocsSourceFiles(srcDir: string, include: Array<string>, exclude: Array<string>): Array<string>
|
|
90
104
|
|
|
@@ -202,6 +216,36 @@ export declare function getSsgPageLocale(urlPath: string, defaultLocale: string,
|
|
|
202
216
|
/** Converts a markdown file path to a relative SSG URL path. */
|
|
203
217
|
export declare function getSsgUrlPath(inputPath: string, srcDir: string): string
|
|
204
218
|
|
|
219
|
+
/**
|
|
220
|
+
* Highlights one fenced code block, returning the full `<pre>` element.
|
|
221
|
+
*
|
|
222
|
+
* Returns `null` when no grammar claims `lang`, which is the caller's signal
|
|
223
|
+
* to fall back — either to another highlighter or to emitting the code
|
|
224
|
+
* unhighlighted. Callers that want to decide before paying for the call can
|
|
225
|
+
* ask [`supports_highlight_language`] instead.
|
|
226
|
+
*/
|
|
227
|
+
export declare function highlightCodeBlock(code: string, lang: string): string | null
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Highlights every code block in a rendered document in one call.
|
|
231
|
+
*
|
|
232
|
+
* The alternative is walking the page through an HTML parser and serializer
|
|
233
|
+
* to find the blocks and splice results back, which on the documentation
|
|
234
|
+
* corpus costs an order of magnitude more than the highlighting itself.
|
|
235
|
+
*/
|
|
236
|
+
export declare function highlightHtmlCodeBlocks(html: string): JsHighlightedDocument
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Highlights a document off the main thread, so pages overlap.
|
|
240
|
+
*
|
|
241
|
+
* The synchronous binding holds the event loop for the whole pass, which
|
|
242
|
+
* makes a caller's concurrency worth nothing: `Promise.all` over the
|
|
243
|
+
* documentation corpus measures the same as awaiting the pages one at a
|
|
244
|
+
* time. Running the pass as a task lets a build that already asks for
|
|
245
|
+
* several pages at once actually get them at once.
|
|
246
|
+
*/
|
|
247
|
+
export declare function highlightHtmlCodeBlocksAsync(html: string): Promise<JsHighlightedDocument>
|
|
248
|
+
|
|
205
249
|
/** Result of i18n checking. */
|
|
206
250
|
export interface I18NCheckResult {
|
|
207
251
|
/** All diagnostics. */
|
|
@@ -282,6 +326,12 @@ export interface IncrementalMarkdownRenderResult {
|
|
|
282
326
|
errors: Array<string>
|
|
283
327
|
}
|
|
284
328
|
|
|
329
|
+
/** Opt-in skip link and print styles. Presence of the object enables the feature. */
|
|
330
|
+
export interface JsA11y {
|
|
331
|
+
/** Override for the skip-link label. Empty / omitted uses "Skip to content". */
|
|
332
|
+
skipLinkLabel?: string
|
|
333
|
+
}
|
|
334
|
+
|
|
285
335
|
/** Attribute syntax transform options. */
|
|
286
336
|
export interface JsAttrsOptions {
|
|
287
337
|
/**
|
|
@@ -292,6 +342,16 @@ export interface JsAttrsOptions {
|
|
|
292
342
|
enabled?: boolean
|
|
293
343
|
}
|
|
294
344
|
|
|
345
|
+
/** Opt-in `{badge:variant}` inline badges. */
|
|
346
|
+
export interface JsBadgeOptions {
|
|
347
|
+
/**
|
|
348
|
+
* Enable `{badge:variant}text{/badge}` expansion.
|
|
349
|
+
*
|
|
350
|
+
* Default: `false`.
|
|
351
|
+
*/
|
|
352
|
+
enabled?: boolean
|
|
353
|
+
}
|
|
354
|
+
|
|
295
355
|
export interface JsBuildCollectionManifestOptions {
|
|
296
356
|
/** Source directory containing Markdown files. */
|
|
297
357
|
srcDir: string
|
|
@@ -305,6 +365,16 @@ export interface JsBuildCollectionManifestOptions {
|
|
|
305
365
|
transformOptions?: JsTransformOptions
|
|
306
366
|
}
|
|
307
367
|
|
|
368
|
+
/** Opt-in `::: card` / `::: link-card` / `::: card-grid` blocks. */
|
|
369
|
+
export interface JsCardOptions {
|
|
370
|
+
/**
|
|
371
|
+
* Enable card, link-card, and card-grid containers.
|
|
372
|
+
*
|
|
373
|
+
* Default: `false`.
|
|
374
|
+
*/
|
|
375
|
+
enabled?: boolean
|
|
376
|
+
}
|
|
377
|
+
|
|
308
378
|
/** Extracted fenced code block. */
|
|
309
379
|
export interface JsCodeBlock {
|
|
310
380
|
language: string
|
|
@@ -379,6 +449,26 @@ export interface JsCollectionDefinition {
|
|
|
379
449
|
include: Array<string>
|
|
380
450
|
}
|
|
381
451
|
|
|
452
|
+
/** Opt-in `::: tip` custom containers. */
|
|
453
|
+
export interface JsContainerOptions {
|
|
454
|
+
/**
|
|
455
|
+
* Enable `::: type` containers.
|
|
456
|
+
*
|
|
457
|
+
* Default: `false`.
|
|
458
|
+
*/
|
|
459
|
+
enabled?: boolean
|
|
460
|
+
/** Extra or overriding container types. */
|
|
461
|
+
types?: Record<string, JsContainerTypeOptions>
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/** Custom container transform options. */
|
|
465
|
+
export interface JsContainerTypeOptions {
|
|
466
|
+
/** Title used when the opener does not set one. */
|
|
467
|
+
title?: string
|
|
468
|
+
/** `"details"` renders `<details>`/`<summary>`; anything else is a `<div>`. */
|
|
469
|
+
tag?: string
|
|
470
|
+
}
|
|
471
|
+
|
|
382
472
|
/** Normalized documentation entry used by generated API docs. */
|
|
383
473
|
export interface JsDocEntry {
|
|
384
474
|
name: string
|
|
@@ -774,6 +864,16 @@ export interface JsFeatureConfig {
|
|
|
774
864
|
linkText?: string
|
|
775
865
|
}
|
|
776
866
|
|
|
867
|
+
/** Opt-in static `file-tree` fences. */
|
|
868
|
+
export interface JsFileTreeOptions {
|
|
869
|
+
/**
|
|
870
|
+
* Enable `file-tree` fences.
|
|
871
|
+
*
|
|
872
|
+
* Default: `false`.
|
|
873
|
+
*/
|
|
874
|
+
enabled?: boolean
|
|
875
|
+
}
|
|
876
|
+
|
|
777
877
|
export interface JsFrameworkComponentIsland {
|
|
778
878
|
name: string
|
|
779
879
|
props: Record<string, any>
|
|
@@ -789,6 +889,16 @@ export interface JsGraphOptions {
|
|
|
789
889
|
externalPackageSources?: Array<JsExternalPackageSource>
|
|
790
890
|
}
|
|
791
891
|
|
|
892
|
+
/** Header nav link or dropdown. */
|
|
893
|
+
export interface JsHeaderNavItem {
|
|
894
|
+
/** Display label. */
|
|
895
|
+
text: string
|
|
896
|
+
/** Link URL. */
|
|
897
|
+
link?: string
|
|
898
|
+
/** Dropdown children. */
|
|
899
|
+
items?: Array<JsHeaderNavItem>
|
|
900
|
+
}
|
|
901
|
+
|
|
792
902
|
/** Hero action for entry page. */
|
|
793
903
|
export interface JsHeroAction {
|
|
794
904
|
/** Button theme: "brand" or "alt". */
|
|
@@ -839,6 +949,24 @@ export interface JsHeroNotice {
|
|
|
839
949
|
body?: Array<string>
|
|
840
950
|
}
|
|
841
951
|
|
|
952
|
+
/** Result of highlighting every code block in a rendered document. */
|
|
953
|
+
export interface JsHighlightedDocument {
|
|
954
|
+
/** The document with each handled block replaced. */
|
|
955
|
+
html: string
|
|
956
|
+
/**
|
|
957
|
+
* Languages of elements the native pass could not read, which means the
|
|
958
|
+
* caller's own highlighter has to produce the whole page. Non-empty
|
|
959
|
+
* leaves `html` untouched and `pending` empty.
|
|
960
|
+
*/
|
|
961
|
+
skipped: Array<string>
|
|
962
|
+
/**
|
|
963
|
+
* Well-formed blocks whose language has no native grammar, in document
|
|
964
|
+
* order. Highlight each one and hand the results to
|
|
965
|
+
* `applyPendingHighlights`; they are still in `html`, unchanged.
|
|
966
|
+
*/
|
|
967
|
+
pending: Array<JsPendingBlock>
|
|
968
|
+
}
|
|
969
|
+
|
|
842
970
|
/** Configuration for generated i18n runtime modules. */
|
|
843
971
|
export interface JsI18NRuntimeConfig {
|
|
844
972
|
/** Default locale tag. */
|
|
@@ -859,6 +987,38 @@ export interface JsI18NRuntimeLocale {
|
|
|
859
987
|
dir?: string
|
|
860
988
|
}
|
|
861
989
|
|
|
990
|
+
/** Opt-in figures, captions, and lazy images. */
|
|
991
|
+
export interface JsImageOptions {
|
|
992
|
+
/**
|
|
993
|
+
* Enable figure captions, lazy loading, and safe dimensions.
|
|
994
|
+
*
|
|
995
|
+
* Default: `false`.
|
|
996
|
+
*/
|
|
997
|
+
enabled?: boolean
|
|
998
|
+
/**
|
|
999
|
+
* Add `loading="lazy"` to transformed images.
|
|
1000
|
+
*
|
|
1001
|
+
* Default: `true`.
|
|
1002
|
+
*/
|
|
1003
|
+
lazy?: boolean
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
/** Markdown file include options. */
|
|
1007
|
+
export interface JsIncludeOptions {
|
|
1008
|
+
/**
|
|
1009
|
+
* Enable `<!-- @include: PATH -->` expansion.
|
|
1010
|
+
*
|
|
1011
|
+
* Default: `false`.
|
|
1012
|
+
*/
|
|
1013
|
+
enabled?: boolean
|
|
1014
|
+
/**
|
|
1015
|
+
* Root directory used for `@/` and absolute include paths.
|
|
1016
|
+
*
|
|
1017
|
+
* Default: project root from the JavaScript caller.
|
|
1018
|
+
*/
|
|
1019
|
+
rootDir?: string
|
|
1020
|
+
}
|
|
1021
|
+
|
|
862
1022
|
/** Options for appending to an incremental parser. */
|
|
863
1023
|
export interface JsIncrementalParseOptions {
|
|
864
1024
|
/** Treat this append as the final stream chunk. */
|
|
@@ -889,6 +1049,16 @@ export interface JsLocaleInfo {
|
|
|
889
1049
|
dir: string
|
|
890
1050
|
}
|
|
891
1051
|
|
|
1052
|
+
/** Sibling page or locale-root href for one locale. */
|
|
1053
|
+
export interface JsLocalePath {
|
|
1054
|
+
/** BCP 47 locale tag. */
|
|
1055
|
+
code: string
|
|
1056
|
+
/** Href of the same page in this locale, when that translation exists. */
|
|
1057
|
+
href?: string
|
|
1058
|
+
/** Locale home href used when `href` is missing. */
|
|
1059
|
+
root?: string
|
|
1060
|
+
}
|
|
1061
|
+
|
|
892
1062
|
export interface JsMarkdownLintDiagnostic {
|
|
893
1063
|
ruleId: string
|
|
894
1064
|
severity: string
|
|
@@ -916,6 +1086,8 @@ export interface JsMarkdownLintOptions {
|
|
|
916
1086
|
languages?: Array<string>
|
|
917
1087
|
rules?: JsMarkdownLintRuleOptions
|
|
918
1088
|
dictionary?: JsMarkdownLintDictionaryOptions
|
|
1089
|
+
/** Enable MDX-aware syntax masking while linting visible prose. */
|
|
1090
|
+
mdx?: boolean
|
|
919
1091
|
}
|
|
920
1092
|
|
|
921
1093
|
export interface JsMarkdownLintResult {
|
|
@@ -936,6 +1108,16 @@ export interface JsMarkdownLintRuleOptions {
|
|
|
936
1108
|
trailingSpaces?: boolean
|
|
937
1109
|
}
|
|
938
1110
|
|
|
1111
|
+
/** Opt-in `$…$` inline and `$$…$$` block math. */
|
|
1112
|
+
export interface JsMathOptions {
|
|
1113
|
+
/**
|
|
1114
|
+
* Enable `$…$` inline and `$$…$$` block math.
|
|
1115
|
+
*
|
|
1116
|
+
* Default: `false` when the whole option is omitted; `true` when this object is present.
|
|
1117
|
+
*/
|
|
1118
|
+
enabled?: boolean
|
|
1119
|
+
}
|
|
1120
|
+
|
|
939
1121
|
/** Built-in media embed transform switches. */
|
|
940
1122
|
export interface JsMediaEmbedsOptions {
|
|
941
1123
|
/**
|
|
@@ -998,6 +1180,27 @@ export interface JsOgImageData {
|
|
|
998
1180
|
author?: string
|
|
999
1181
|
}
|
|
1000
1182
|
|
|
1183
|
+
/** Per-page frontmatter chrome flags. */
|
|
1184
|
+
export interface JsPageChromeFlags {
|
|
1185
|
+
sidebar?: boolean
|
|
1186
|
+
outline?: boolean
|
|
1187
|
+
aside?: boolean
|
|
1188
|
+
footer?: boolean
|
|
1189
|
+
navbar?: boolean
|
|
1190
|
+
lastUpdated?: boolean
|
|
1191
|
+
editLink?: boolean
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
/** Frontmatter override for one previous/next pager side. */
|
|
1195
|
+
export interface JsPagerOverride {
|
|
1196
|
+
/** Hide this side when true. */
|
|
1197
|
+
hidden?: boolean
|
|
1198
|
+
/** Replacement title. */
|
|
1199
|
+
text?: string
|
|
1200
|
+
/** Replacement href. */
|
|
1201
|
+
href?: string
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1001
1204
|
/**
|
|
1002
1205
|
* Parser options for JavaScript.
|
|
1003
1206
|
*
|
|
@@ -1010,6 +1213,12 @@ export interface JsParserOptions {
|
|
|
1010
1213
|
* Default: `false`.
|
|
1011
1214
|
*/
|
|
1012
1215
|
gfm?: boolean
|
|
1216
|
+
/**
|
|
1217
|
+
* Enable MDX JSX, ESM, and expression nodes.
|
|
1218
|
+
*
|
|
1219
|
+
* Default: `false`.
|
|
1220
|
+
*/
|
|
1221
|
+
mdx?: boolean
|
|
1013
1222
|
/**
|
|
1014
1223
|
* Enable footnote references and definitions.
|
|
1015
1224
|
*
|
|
@@ -1042,6 +1251,14 @@ export interface JsParserOptions {
|
|
|
1042
1251
|
autolinks?: boolean
|
|
1043
1252
|
}
|
|
1044
1253
|
|
|
1254
|
+
/** A block the native pass left for the caller's highlighter. */
|
|
1255
|
+
export interface JsPendingBlock {
|
|
1256
|
+
/** The `language-…` class the block carries. */
|
|
1257
|
+
language: string
|
|
1258
|
+
/** The block's source text, already unescaped. */
|
|
1259
|
+
source: string
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1045
1262
|
/** Options for [`super::transform_pm_embeds`]. */
|
|
1046
1263
|
export interface JsPmOptions {
|
|
1047
1264
|
/**
|
|
@@ -1072,6 +1289,34 @@ export interface JsPublicExport {
|
|
|
1072
1289
|
source: JsExportSource
|
|
1073
1290
|
}
|
|
1074
1291
|
|
|
1292
|
+
/** Whether a page should be written and listed. */
|
|
1293
|
+
export interface JsPublishDecision {
|
|
1294
|
+
/** Write HTML for this page. */
|
|
1295
|
+
output: boolean
|
|
1296
|
+
/** Include the page in nav, sitemap, and search. */
|
|
1297
|
+
listed: boolean
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
/** JavaScript publish-state options. */
|
|
1301
|
+
export interface JsPublishStateOptions {
|
|
1302
|
+
/** When false, every page stays published and listed. */
|
|
1303
|
+
enabled?: boolean
|
|
1304
|
+
/** Injected ISO-8601 clock used for scheduled / expiry comparison. */
|
|
1305
|
+
now?: string
|
|
1306
|
+
/** Keep draft and not-yet-scheduled pages visible (dev preview). */
|
|
1307
|
+
includeDrafts?: boolean
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/** Opt-in reader chrome flags. Presence of the object enables the feature. */
|
|
1311
|
+
export interface JsReaderChrome {
|
|
1312
|
+
/** Copy button on fenced code blocks. */
|
|
1313
|
+
copy?: boolean
|
|
1314
|
+
/** Icon and `rel` on outbound links. */
|
|
1315
|
+
externalLinks?: boolean
|
|
1316
|
+
/** Back-to-top control that appears after scroll. */
|
|
1317
|
+
backToTop?: boolean
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1075
1320
|
/** Resolved source module. */
|
|
1076
1321
|
export interface JsResolvedModule {
|
|
1077
1322
|
path: string
|
|
@@ -1130,6 +1375,14 @@ export interface JsSearchDocument {
|
|
|
1130
1375
|
code: Array<string>
|
|
1131
1376
|
}
|
|
1132
1377
|
|
|
1378
|
+
/** Optional filters for directory search-index construction. */
|
|
1379
|
+
export interface JsSearchIndexBuildOptions {
|
|
1380
|
+
/** Publish-state filter applied while walking Markdown files. */
|
|
1381
|
+
publishState?: JsPublishStateOptions
|
|
1382
|
+
/** Explicit MDX parser override. When omitted, `.mdx` files enable MDX. */
|
|
1383
|
+
mdx?: boolean
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1133
1386
|
/** Search options for JavaScript. */
|
|
1134
1387
|
export interface JsSearchOptions {
|
|
1135
1388
|
/** Maximum number of results. */
|
|
@@ -1290,6 +1543,8 @@ export interface JsSsgConfig {
|
|
|
1290
1543
|
siteName: string
|
|
1291
1544
|
/** Base URL path. */
|
|
1292
1545
|
base: string
|
|
1546
|
+
/** Optional site-root href for breadcrumbs. */
|
|
1547
|
+
breadcrumbRootHref?: string
|
|
1293
1548
|
/** OG image URL. */
|
|
1294
1549
|
ogImage?: string
|
|
1295
1550
|
/** Theme configuration. */
|
|
@@ -1298,6 +1553,22 @@ export interface JsSsgConfig {
|
|
|
1298
1553
|
locale?: string
|
|
1299
1554
|
/** Available locales for locale switcher. */
|
|
1300
1555
|
availableLocales?: Array<JsLocaleInfo>
|
|
1556
|
+
/** When true, render previous/next page links after the article. */
|
|
1557
|
+
pagination?: boolean
|
|
1558
|
+
/** When true, render a breadcrumb trail above the article. */
|
|
1559
|
+
breadcrumbs?: boolean
|
|
1560
|
+
/** Opt-in copy, external-link, and back-to-top chrome. */
|
|
1561
|
+
readerChrome?: JsReaderChrome
|
|
1562
|
+
/** Opt-in header locale switcher. */
|
|
1563
|
+
localeSwitcher?: boolean
|
|
1564
|
+
/** Existing sibling hrefs and locale roots. */
|
|
1565
|
+
localePaths?: Array<JsLocalePath>
|
|
1566
|
+
/** Opt-in skip link and print styles. Presence enables the feature. */
|
|
1567
|
+
a11y?: JsA11y
|
|
1568
|
+
/** Opt-in team / members page. Omitted stays off. */
|
|
1569
|
+
team?: JsTeamOptions
|
|
1570
|
+
/** When true, honor per-page frontmatter chrome flags. */
|
|
1571
|
+
pageChrome?: boolean
|
|
1301
1572
|
}
|
|
1302
1573
|
|
|
1303
1574
|
/** Result of SSG shared asset extraction. */
|
|
@@ -1370,6 +1641,16 @@ export interface JsSsgPageData {
|
|
|
1370
1641
|
path: string
|
|
1371
1642
|
/** Entry page configuration (if layout: entry). */
|
|
1372
1643
|
entryPage?: JsEntryPageConfig
|
|
1644
|
+
/** Frontmatter override for the previous-page link. */
|
|
1645
|
+
prev?: JsPagerOverride
|
|
1646
|
+
/** Frontmatter override for the next-page link. */
|
|
1647
|
+
next?: JsPagerOverride
|
|
1648
|
+
/** Frontmatter `breadcrumbs: false` hides the trail on this page. */
|
|
1649
|
+
breadcrumbs?: boolean
|
|
1650
|
+
/** Frontmatter `layout`. `team` renders member cards when the option is on. */
|
|
1651
|
+
layout?: string
|
|
1652
|
+
/** Per-page chrome flags. Honored only when page chrome is enabled. */
|
|
1653
|
+
chrome?: JsPageChromeFlags
|
|
1373
1654
|
}
|
|
1374
1655
|
|
|
1375
1656
|
/** Resolved SSG output and public route paths. */
|
|
@@ -1410,6 +1691,11 @@ export interface JsSsgSidebarItem {
|
|
|
1410
1691
|
stickyCollapsed?: boolean
|
|
1411
1692
|
}
|
|
1412
1693
|
|
|
1694
|
+
/** Opt-in `::: steps` wrappers. `enabled` defaults to `false`. */
|
|
1695
|
+
export interface JsStepsOptions {
|
|
1696
|
+
enabled?: boolean
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1413
1699
|
/** Result of [`super::transform_tabs_embeds`]. */
|
|
1414
1700
|
export interface JsTabsTransformResult {
|
|
1415
1701
|
/** HTML with every `<tabs>` block expanded. */
|
|
@@ -1421,6 +1707,44 @@ export interface JsTabsTransformResult {
|
|
|
1421
1707
|
groupCount: number
|
|
1422
1708
|
}
|
|
1423
1709
|
|
|
1710
|
+
/** One link on a team member card. */
|
|
1711
|
+
export interface JsTeamLink {
|
|
1712
|
+
/** Visible label. */
|
|
1713
|
+
label: string
|
|
1714
|
+
/** Destination URL. */
|
|
1715
|
+
href: string
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/** One person on the team page. */
|
|
1719
|
+
export interface JsTeamMember {
|
|
1720
|
+
/** Display name. */
|
|
1721
|
+
name: string
|
|
1722
|
+
/** Optional role or title. */
|
|
1723
|
+
role?: string
|
|
1724
|
+
/** Avatar URL. */
|
|
1725
|
+
avatar?: string
|
|
1726
|
+
/** Optional profile or social links. */
|
|
1727
|
+
links?: Array<JsTeamLink>
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
/** Opt-in team / members page. Presence of the object enables the feature. */
|
|
1731
|
+
export interface JsTeamOptions {
|
|
1732
|
+
/** When false, `layout: team` is ignored. */
|
|
1733
|
+
enabled?: boolean
|
|
1734
|
+
/** Members rendered as static cards. */
|
|
1735
|
+
members?: Array<JsTeamMember>
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
/** Announcement bar for JavaScript. */
|
|
1739
|
+
export interface JsThemeAnnouncement {
|
|
1740
|
+
/** Escaped bar text. */
|
|
1741
|
+
text: string
|
|
1742
|
+
/** Optional https or same-origin link. */
|
|
1743
|
+
link?: string
|
|
1744
|
+
/** localStorage key used to persist dismiss. */
|
|
1745
|
+
dismissKey?: string
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1424
1748
|
/** Theme colors for JavaScript. */
|
|
1425
1749
|
export interface JsThemeColors {
|
|
1426
1750
|
/** Primary accent color. */
|
|
@@ -1447,6 +1771,12 @@ export interface JsThemeColors {
|
|
|
1447
1771
|
|
|
1448
1772
|
/** Theme configuration for JavaScript. */
|
|
1449
1773
|
export interface JsThemeConfig {
|
|
1774
|
+
/** Progressive cross-document transitions for same-origin MPA navigation. */
|
|
1775
|
+
viewTransitions?: boolean
|
|
1776
|
+
/** Right-hand "On this page" outline. Omitted and `false` hide it. */
|
|
1777
|
+
aside?: boolean
|
|
1778
|
+
/** Breadcrumb trail from the site root through sidebar ancestors. */
|
|
1779
|
+
breadcrumbs?: boolean
|
|
1450
1780
|
/** Light mode colors. */
|
|
1451
1781
|
colors?: JsThemeColors
|
|
1452
1782
|
/** Dark mode colors. */
|
|
@@ -1459,6 +1789,10 @@ export interface JsThemeConfig {
|
|
|
1459
1789
|
layout?: JsThemeLayout
|
|
1460
1790
|
/** Header configuration. */
|
|
1461
1791
|
header?: JsThemeHeader
|
|
1792
|
+
/** Opt-in header nav items. */
|
|
1793
|
+
nav?: Array<JsHeaderNavItem>
|
|
1794
|
+
/** Opt-in announcement bar. */
|
|
1795
|
+
announcement?: JsThemeAnnouncement
|
|
1462
1796
|
/** Footer configuration. */
|
|
1463
1797
|
footer?: JsThemeFooter
|
|
1464
1798
|
/** Social links configuration. */
|
|
@@ -1554,6 +1888,12 @@ export interface JsTransformOptions {
|
|
|
1554
1888
|
* Default: `false`.
|
|
1555
1889
|
*/
|
|
1556
1890
|
gfm?: boolean
|
|
1891
|
+
/**
|
|
1892
|
+
* Enable MDX JSX, ESM, and expression nodes.
|
|
1893
|
+
*
|
|
1894
|
+
* Default: `false`.
|
|
1895
|
+
*/
|
|
1896
|
+
mdx?: boolean
|
|
1557
1897
|
/**
|
|
1558
1898
|
* Enable footnote references and definitions.
|
|
1559
1899
|
*
|
|
@@ -1715,6 +2055,54 @@ export interface JsTransformOptions {
|
|
|
1715
2055
|
* Default: disabled.
|
|
1716
2056
|
*/
|
|
1717
2057
|
editThisPage?: JsEditThisPageOptions
|
|
2058
|
+
/**
|
|
2059
|
+
* Opt-in `::: tip` custom containers.
|
|
2060
|
+
*
|
|
2061
|
+
* Default: disabled.
|
|
2062
|
+
*/
|
|
2063
|
+
containers?: JsContainerOptions
|
|
2064
|
+
/**
|
|
2065
|
+
* Opt-in Markdown file includes via `<!-- @include: PATH -->`.
|
|
2066
|
+
*
|
|
2067
|
+
* Default: disabled.
|
|
2068
|
+
*/
|
|
2069
|
+
includes?: JsIncludeOptions
|
|
2070
|
+
/**
|
|
2071
|
+
* Opt-in `::: steps` ordered lists.
|
|
2072
|
+
*
|
|
2073
|
+
* Default: disabled.
|
|
2074
|
+
*/
|
|
2075
|
+
steps?: JsStepsOptions
|
|
2076
|
+
/**
|
|
2077
|
+
* Opt-in `{badge:variant}` inline badges.
|
|
2078
|
+
*
|
|
2079
|
+
* Default: disabled.
|
|
2080
|
+
*/
|
|
2081
|
+
badges?: JsBadgeOptions
|
|
2082
|
+
/**
|
|
2083
|
+
* Opt-in figures, captions, and lazy images.
|
|
2084
|
+
*
|
|
2085
|
+
* Default: disabled.
|
|
2086
|
+
*/
|
|
2087
|
+
images?: JsImageOptions
|
|
2088
|
+
/**
|
|
2089
|
+
* Opt-in `::: card` / `::: link-card` / `::: card-grid` blocks.
|
|
2090
|
+
*
|
|
2091
|
+
* Default: disabled.
|
|
2092
|
+
*/
|
|
2093
|
+
cards?: JsCardOptions
|
|
2094
|
+
/**
|
|
2095
|
+
* Opt-in `$…$` inline and `$$…$$` block math.
|
|
2096
|
+
*
|
|
2097
|
+
* Default: disabled.
|
|
2098
|
+
*/
|
|
2099
|
+
math?: boolean | JsMathOptions
|
|
2100
|
+
/**
|
|
2101
|
+
* Opt-in static `file-tree` fences.
|
|
2102
|
+
*
|
|
2103
|
+
* Default: disabled.
|
|
2104
|
+
*/
|
|
2105
|
+
fileTree?: JsFileTreeOptions
|
|
1718
2106
|
}
|
|
1719
2107
|
|
|
1720
2108
|
/** Type parameter documentation (`<T extends C = D>`) used by generated API docs. */
|
|
@@ -1819,6 +2207,9 @@ export interface Mf2ValidateResult {
|
|
|
1819
2207
|
astJson?: string
|
|
1820
2208
|
}
|
|
1821
2209
|
|
|
2210
|
+
/** Every language name and alias the native highlighter answers to. */
|
|
2211
|
+
export declare function nativeHighlightLanguages(): Array<string>
|
|
2212
|
+
|
|
1822
2213
|
/** Normalizes VitePress-specific frontmatter into ox-content's entry-page shape. */
|
|
1823
2214
|
export declare function normalizeVitePressFrontmatter(frontmatter: any): any
|
|
1824
2215
|
|
|
@@ -1914,6 +2305,9 @@ export declare function sanitizeHtml(html: string, options?: JsSanitizeOptions |
|
|
|
1914
2305
|
*/
|
|
1915
2306
|
export declare function searchIndex(indexJson: string, query: string, options?: JsSearchOptions | undefined | null): Array<JsSearchResult>
|
|
1916
2307
|
|
|
2308
|
+
/** Whether a fenced code block tagged `lang` will be highlighted natively. */
|
|
2309
|
+
export declare function supportsHighlightLanguage(lang: string): boolean
|
|
2310
|
+
|
|
1917
2311
|
/** Table of contents entry. */
|
|
1918
2312
|
export interface TocEntry {
|
|
1919
2313
|
/** Heading depth (1-6). */
|
package/index.js
CHANGED
|
@@ -197,6 +197,7 @@ module.exports.mergeHighlightedCodeBlocks = binding.mergeHighlightedCodeBlocks;
|
|
|
197
197
|
module.exports.generateOgImageSvg = binding.generateOgImageSvg;
|
|
198
198
|
module.exports.buildSearchIndex = binding.buildSearchIndex;
|
|
199
199
|
module.exports.buildSearchIndexFromDirectory = binding.buildSearchIndexFromDirectory;
|
|
200
|
+
module.exports.classifyPublishState = binding.classifyPublishState;
|
|
200
201
|
module.exports.writeSearchIndex = binding.writeSearchIndex;
|
|
201
202
|
module.exports.searchIndex = binding.searchIndex;
|
|
202
203
|
module.exports.extractSearchContent = binding.extractSearchContent;
|
|
@@ -209,6 +210,12 @@ module.exports.collectSearchMarkdownFiles = binding.collectSearchMarkdownFiles;
|
|
|
209
210
|
module.exports.normalizeVitePressFrontmatter = binding.normalizeVitePressFrontmatter;
|
|
210
211
|
module.exports.generateSsgHtml = binding.generateSsgHtml;
|
|
211
212
|
module.exports.generateSsgBareHtml = binding.generateSsgBareHtml;
|
|
213
|
+
module.exports.highlightCodeBlock = binding.highlightCodeBlock;
|
|
214
|
+
module.exports.applyPendingHighlights = binding.applyPendingHighlights;
|
|
215
|
+
module.exports.highlightHtmlCodeBlocks = binding.highlightHtmlCodeBlocks;
|
|
216
|
+
module.exports.highlightHtmlCodeBlocksAsync = binding.highlightHtmlCodeBlocksAsync;
|
|
217
|
+
module.exports.supportsHighlightLanguage = binding.supportsHighlightLanguage;
|
|
218
|
+
module.exports.nativeHighlightLanguages = binding.nativeHighlightLanguages;
|
|
212
219
|
module.exports.generateSsgBarePage = binding.generateSsgBarePage;
|
|
213
220
|
module.exports.getGitLastUpdated = binding.getGitLastUpdated;
|
|
214
221
|
module.exports.resolveSsgRoutePaths = binding.resolveSsgRoutePaths;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox-content/napi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.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": "
|
|
51
|
-
"@ox-content/binding-darwin-arm64": "
|
|
52
|
-
"@ox-content/binding-linux-x64-gnu": "
|
|
53
|
-
"@ox-content/binding-linux-x64-musl": "
|
|
54
|
-
"@ox-content/binding-linux-arm64-gnu": "
|
|
55
|
-
"@ox-content/binding-linux-arm64-musl": "
|
|
56
|
-
"@ox-content/binding-win32-x64-msvc": "
|
|
50
|
+
"@ox-content/binding-darwin-x64": "3.0.0-alpha.1",
|
|
51
|
+
"@ox-content/binding-darwin-arm64": "3.0.0-alpha.1",
|
|
52
|
+
"@ox-content/binding-linux-x64-gnu": "3.0.0-alpha.1",
|
|
53
|
+
"@ox-content/binding-linux-x64-musl": "3.0.0-alpha.1",
|
|
54
|
+
"@ox-content/binding-linux-arm64-gnu": "3.0.0-alpha.1",
|
|
55
|
+
"@ox-content/binding-linux-arm64-musl": "3.0.0-alpha.1",
|
|
56
|
+
"@ox-content/binding-win32-x64-msvc": "3.0.0-alpha.1"
|
|
57
57
|
}
|
|
58
58
|
}
|