@ox-content/vite-plugin 2.9.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/github.cjs +381 -10
- package/dist/github.cjs.map +1 -1
- package/dist/github.mjs +352 -11
- package/dist/github.mjs.map +1 -1
- package/dist/index.cjs +248 -302
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +358 -167
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +358 -167
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +229 -298
- package/dist/index.mjs.map +1 -1
- package/dist/vitepress-cli.cjs +186 -0
- package/dist/vitepress-cli.cjs.map +1 -0
- package/dist/vitepress-cli.d.cts +1 -0
- package/dist/vitepress-cli.d.mts +1 -0
- package/dist/vitepress-cli.mjs +185 -0
- package/dist/vitepress-cli.mjs.map +1 -0
- package/dist/vitepress.cjs +548 -0
- package/dist/vitepress.cjs.map +1 -0
- package/dist/vitepress.mjs +489 -0
- package/dist/vitepress.mjs.map +1 -0
- package/package.json +9 -2
package/dist/index.d.mts
CHANGED
|
@@ -220,6 +220,210 @@ declare function mergeThemes(...themes: ThemeConfig[]): ThemeConfig;
|
|
|
220
220
|
*/
|
|
221
221
|
declare function resolveTheme(config?: ThemeConfig): ResolvedThemeConfig;
|
|
222
222
|
//#endregion
|
|
223
|
+
//#region src/plugins/github.d.ts
|
|
224
|
+
/**
|
|
225
|
+
* GitHub Plugin - Repository and source code embedding
|
|
226
|
+
*
|
|
227
|
+
* Transforms <GitHub> components into static repository and source code cards
|
|
228
|
+
* by fetching data from GitHub API at build time.
|
|
229
|
+
*/
|
|
230
|
+
interface GitHubRepoData {
|
|
231
|
+
name: string;
|
|
232
|
+
full_name: string;
|
|
233
|
+
description: string | null;
|
|
234
|
+
html_url: string;
|
|
235
|
+
stargazers_count: number;
|
|
236
|
+
forks_count: number;
|
|
237
|
+
language: string | null;
|
|
238
|
+
owner: {
|
|
239
|
+
login: string;
|
|
240
|
+
avatar_url: string;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
interface GitHubLineRange {
|
|
244
|
+
start: number;
|
|
245
|
+
end: number;
|
|
246
|
+
}
|
|
247
|
+
interface GitHubSourceRef {
|
|
248
|
+
repo: string;
|
|
249
|
+
ref: string;
|
|
250
|
+
path: string;
|
|
251
|
+
permalink: string;
|
|
252
|
+
lines?: GitHubLineRange;
|
|
253
|
+
}
|
|
254
|
+
interface GitHubSourceData {
|
|
255
|
+
repo: string;
|
|
256
|
+
ref: string;
|
|
257
|
+
path: string;
|
|
258
|
+
permalink: string;
|
|
259
|
+
content: string;
|
|
260
|
+
size: number;
|
|
261
|
+
html_url: string;
|
|
262
|
+
language: string | null;
|
|
263
|
+
}
|
|
264
|
+
interface GitHubOptions {
|
|
265
|
+
/** GitHub API token for higher rate limits. */
|
|
266
|
+
token?: string;
|
|
267
|
+
/** Cache fetched data. Default: true */
|
|
268
|
+
cache?: boolean;
|
|
269
|
+
/** Cache TTL in milliseconds. Default: 3600000 (1 hour) */
|
|
270
|
+
cacheTTL?: number;
|
|
271
|
+
/** Maximum source file size to inline in bytes. Default: 200000 */
|
|
272
|
+
maxSourceBytes?: number;
|
|
273
|
+
/** Maximum source lines to inline when no line range is specified. Default: 120 */
|
|
274
|
+
maxSourceLines?: number;
|
|
275
|
+
}
|
|
276
|
+
declare function parseGitHubLineRange(value: string | undefined): GitHubLineRange | undefined;
|
|
277
|
+
declare function parseGitHubPermalink(value: string): GitHubSourceRef | null;
|
|
278
|
+
/**
|
|
279
|
+
* Fetch repository data from GitHub API.
|
|
280
|
+
*/
|
|
281
|
+
declare function fetchRepoData(repo: string, options: Required<GitHubOptions>): Promise<GitHubRepoData | null>;
|
|
282
|
+
/**
|
|
283
|
+
* Fetch source file data from GitHub API.
|
|
284
|
+
*/
|
|
285
|
+
declare function fetchGitHubSource(source: GitHubSourceRef, options: Required<GitHubOptions>): Promise<GitHubSourceData | null>;
|
|
286
|
+
/**
|
|
287
|
+
* Collect all GitHub repos from HTML for pre-fetching.
|
|
288
|
+
*/
|
|
289
|
+
declare function collectGitHubRepos(html: string): Promise<string[]>;
|
|
290
|
+
/**
|
|
291
|
+
* Collect all GitHub source references from HTML for pre-fetching.
|
|
292
|
+
*/
|
|
293
|
+
declare function collectGitHubSources(html: string): Promise<GitHubSourceRef[]>;
|
|
294
|
+
/**
|
|
295
|
+
* Pre-fetch all GitHub repos data.
|
|
296
|
+
*/
|
|
297
|
+
declare function prefetchGitHubRepos(repos: string[], options?: GitHubOptions): Promise<Map<string, GitHubRepoData | null>>;
|
|
298
|
+
/**
|
|
299
|
+
* Pre-fetch all GitHub source files.
|
|
300
|
+
*/
|
|
301
|
+
declare function prefetchGitHubSources(sources: GitHubSourceRef[], options?: GitHubOptions): Promise<Map<string, GitHubSourceData | null>>;
|
|
302
|
+
/**
|
|
303
|
+
* Transform GitHub components in HTML.
|
|
304
|
+
*/
|
|
305
|
+
declare function transformGitHub(html: string, repoDataMap?: Map<string, GitHubRepoData | null>, options?: GitHubOptions): Promise<string>;
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region src/plugins/ogp.d.ts
|
|
308
|
+
/**
|
|
309
|
+
* OGP Card Plugin - Link card embedding
|
|
310
|
+
*
|
|
311
|
+
* Transforms <OgCard> components into static link preview cards
|
|
312
|
+
* by fetching OGP metadata at build time.
|
|
313
|
+
*/
|
|
314
|
+
interface OgpData {
|
|
315
|
+
url: string;
|
|
316
|
+
title: string;
|
|
317
|
+
description?: string;
|
|
318
|
+
image?: string;
|
|
319
|
+
siteName?: string;
|
|
320
|
+
favicon?: string;
|
|
321
|
+
}
|
|
322
|
+
interface OgpOptions {
|
|
323
|
+
/** Request timeout in milliseconds. Default: 10000 */
|
|
324
|
+
timeout?: number;
|
|
325
|
+
/** Cache fetched data. Default: true */
|
|
326
|
+
cache?: boolean;
|
|
327
|
+
/** Cache TTL in milliseconds. Default: 3600000 (1 hour) */
|
|
328
|
+
cacheTTL?: number;
|
|
329
|
+
/** User agent for requests */
|
|
330
|
+
userAgent?: string;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Fetch OGP data for a URL.
|
|
334
|
+
*/
|
|
335
|
+
declare function fetchOgpData(url: string, options: Required<OgpOptions>): Promise<OgpData | null>;
|
|
336
|
+
/**
|
|
337
|
+
* Collect all OGP URLs from HTML for pre-fetching.
|
|
338
|
+
*/
|
|
339
|
+
declare function collectOgpUrls(html: string): Promise<string[]>;
|
|
340
|
+
/**
|
|
341
|
+
* Pre-fetch all OGP data.
|
|
342
|
+
*/
|
|
343
|
+
declare function prefetchOgpData(urls: string[], options?: OgpOptions): Promise<Map<string, OgpData | null>>;
|
|
344
|
+
/**
|
|
345
|
+
* Transform OgCard components in HTML.
|
|
346
|
+
*/
|
|
347
|
+
declare function transformOgp(html: string, ogpDataMap?: Map<string, OgpData | null>, options?: OgpOptions): Promise<string>;
|
|
348
|
+
//#endregion
|
|
349
|
+
//#region src/plugins/tabs.d.ts
|
|
350
|
+
/**
|
|
351
|
+
* Transform Tabs components in HTML.
|
|
352
|
+
*/
|
|
353
|
+
declare function transformTabs(html: string): Promise<string>;
|
|
354
|
+
/**
|
|
355
|
+
* Generate dynamic CSS for :has() based tab switching.
|
|
356
|
+
* This is needed because :has() selectors need unique IDs.
|
|
357
|
+
*/
|
|
358
|
+
declare function generateTabsCSS(groupCount: number): string;
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/plugins/youtube.d.ts
|
|
361
|
+
/**
|
|
362
|
+
* YouTube Plugin - Privacy-enhanced iframe embedding
|
|
363
|
+
*
|
|
364
|
+
* Transforms <YouTube> components into responsive iframe embeds
|
|
365
|
+
* using youtube-nocookie.com for enhanced privacy.
|
|
366
|
+
*/
|
|
367
|
+
interface YouTubeOptions {
|
|
368
|
+
/** Use privacy-enhanced mode (youtube-nocookie.com). Default: true */
|
|
369
|
+
privacyEnhanced?: boolean;
|
|
370
|
+
/** Default aspect ratio. Default: "16/9" */
|
|
371
|
+
aspectRatio?: string;
|
|
372
|
+
/** Allow fullscreen. Default: true */
|
|
373
|
+
allowFullscreen?: boolean;
|
|
374
|
+
/** Lazy load iframe. Default: true */
|
|
375
|
+
lazyLoad?: boolean;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Extract YouTube video ID from various URL formats.
|
|
379
|
+
*/
|
|
380
|
+
declare function extractVideoId(input: string): string | null;
|
|
381
|
+
/**
|
|
382
|
+
* Transform YouTube components in HTML.
|
|
383
|
+
*/
|
|
384
|
+
declare function transformYouTube(html: string, options?: YouTubeOptions): Promise<string>;
|
|
385
|
+
//#endregion
|
|
386
|
+
//#region src/plugins/mermaid.d.ts
|
|
387
|
+
/**
|
|
388
|
+
* Mermaid Plugin - Native Rust renderer via NAPI
|
|
389
|
+
*
|
|
390
|
+
* Renders mermaid code blocks to SVG using the native Rust renderer
|
|
391
|
+
* via NAPI. Delegates to the NAPI `transformMermaid` function which
|
|
392
|
+
* extracts mermaid code blocks from HTML and renders them using mmdc.
|
|
393
|
+
*/
|
|
394
|
+
interface MermaidOptions {
|
|
395
|
+
/** Mermaid theme. Default: "neutral" */
|
|
396
|
+
theme?: "default" | "dark" | "forest" | "neutral" | "base";
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Transforms mermaid code blocks in HTML to rendered SVG diagrams.
|
|
400
|
+
* Uses the native Rust NAPI transformMermaid function.
|
|
401
|
+
*/
|
|
402
|
+
declare function transformMermaidStatic(html: string, _options?: MermaidOptions): Promise<string>;
|
|
403
|
+
/**
|
|
404
|
+
* @deprecated No longer used. Mermaid rendering is now done at build time via NAPI.
|
|
405
|
+
*/
|
|
406
|
+
declare const mermaidClientScript = "";
|
|
407
|
+
//#endregion
|
|
408
|
+
//#region src/plugins/index.d.ts
|
|
409
|
+
/**
|
|
410
|
+
* Transform all plugin components in HTML.
|
|
411
|
+
* Call this during SSG build to process all plugins at once.
|
|
412
|
+
*/
|
|
413
|
+
interface TransformAllOptions {
|
|
414
|
+
tabs?: boolean;
|
|
415
|
+
youtube?: boolean;
|
|
416
|
+
github?: boolean | GitHubOptions;
|
|
417
|
+
ogp?: boolean | OgpOptions;
|
|
418
|
+
openGraph?: boolean | OgpOptions;
|
|
419
|
+
mermaid?: boolean;
|
|
420
|
+
githubToken?: string;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Transform all enabled plugins in HTML content.
|
|
424
|
+
*/
|
|
425
|
+
declare function transformAllPlugins(html: string, options?: TransformAllOptions): Promise<string>;
|
|
426
|
+
//#endregion
|
|
223
427
|
//#region src/types.d.ts
|
|
224
428
|
/**
|
|
225
429
|
* Hero section action button.
|
|
@@ -301,6 +505,32 @@ interface EntryPageConfig {
|
|
|
301
505
|
/** Feature cards */
|
|
302
506
|
features?: FeatureConfig[];
|
|
303
507
|
}
|
|
508
|
+
/**
|
|
509
|
+
* Navigation item for SSG sidebar rendering.
|
|
510
|
+
*/
|
|
511
|
+
interface SsgNavigationItem {
|
|
512
|
+
/** Display title */
|
|
513
|
+
title: string;
|
|
514
|
+
/**
|
|
515
|
+
* Route path used for active-state matching.
|
|
516
|
+
* Internal links should use site-relative paths such as `/getting-started`.
|
|
517
|
+
*/
|
|
518
|
+
path?: string;
|
|
519
|
+
/**
|
|
520
|
+
* Final href used in the rendered HTML.
|
|
521
|
+
* When omitted for internal links, ox-content derives it from `path`.
|
|
522
|
+
*/
|
|
523
|
+
href?: string;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Navigation group for SSG sidebar rendering.
|
|
527
|
+
*/
|
|
528
|
+
interface SsgNavigationGroup {
|
|
529
|
+
/** Group heading */
|
|
530
|
+
title: string;
|
|
531
|
+
/** Navigation items within this group */
|
|
532
|
+
items: SsgNavigationItem[];
|
|
533
|
+
}
|
|
304
534
|
/**
|
|
305
535
|
* SSG (Static Site Generation) options.
|
|
306
536
|
*/
|
|
@@ -357,6 +587,11 @@ interface SsgOptions {
|
|
|
357
587
|
* Use defineTheme() to create a theme configuration.
|
|
358
588
|
*/
|
|
359
589
|
theme?: ThemeConfig;
|
|
590
|
+
/**
|
|
591
|
+
* Override the auto-generated sidebar navigation.
|
|
592
|
+
* Useful when migrating from tools with explicit navigation config such as VitePress.
|
|
593
|
+
*/
|
|
594
|
+
navigation?: SsgNavigationGroup[];
|
|
360
595
|
}
|
|
361
596
|
/**
|
|
362
597
|
* Resolved SSG options.
|
|
@@ -372,6 +607,7 @@ interface ResolvedSsgOptions {
|
|
|
372
607
|
lastUpdated: boolean;
|
|
373
608
|
siteUrl?: string;
|
|
374
609
|
theme?: ResolvedThemeConfig;
|
|
610
|
+
navigation?: SsgNavigationGroup[];
|
|
375
611
|
}
|
|
376
612
|
/**
|
|
377
613
|
* Plugin options.
|
|
@@ -392,6 +628,11 @@ interface OxContentOptions {
|
|
|
392
628
|
* @default '/'
|
|
393
629
|
*/
|
|
394
630
|
base?: string;
|
|
631
|
+
/**
|
|
632
|
+
* Markdown-like file extensions to process.
|
|
633
|
+
* @default ['.md', '.markdown', '.mdx']
|
|
634
|
+
*/
|
|
635
|
+
extensions?: string[];
|
|
395
636
|
/**
|
|
396
637
|
* SSG (Static Site Generation) options.
|
|
397
638
|
* Set to false to disable SSG completely.
|
|
@@ -502,6 +743,12 @@ interface OxContentOptions {
|
|
|
502
743
|
* @default true
|
|
503
744
|
*/
|
|
504
745
|
ogViewer?: boolean;
|
|
746
|
+
/**
|
|
747
|
+
* Built-in static embeds rendered during Markdown transformation.
|
|
748
|
+
* Set to `false` to disable all built-in embeds.
|
|
749
|
+
* @default { github: true, openGraph: true }
|
|
750
|
+
*/
|
|
751
|
+
embeds?: BuiltinEmbedOptions | false;
|
|
505
752
|
/**
|
|
506
753
|
* i18n (internationalization) options.
|
|
507
754
|
* Set to false to disable i18n.
|
|
@@ -516,6 +763,7 @@ interface ResolvedOptions {
|
|
|
516
763
|
srcDir: string;
|
|
517
764
|
outDir: string;
|
|
518
765
|
base: string;
|
|
766
|
+
extensions: string[];
|
|
519
767
|
ssg: ResolvedSsgOptions;
|
|
520
768
|
gfm: boolean;
|
|
521
769
|
footnotes: boolean;
|
|
@@ -536,8 +784,33 @@ interface ResolvedOptions {
|
|
|
536
784
|
docs: ResolvedDocsOptions | false;
|
|
537
785
|
search: ResolvedSearchOptions;
|
|
538
786
|
ogViewer: boolean;
|
|
787
|
+
embeds: ResolvedBuiltinEmbedOptions;
|
|
539
788
|
i18n: ResolvedI18nOptions | false;
|
|
540
789
|
}
|
|
790
|
+
/**
|
|
791
|
+
* Built-in embed configuration.
|
|
792
|
+
*/
|
|
793
|
+
interface BuiltinEmbedOptions {
|
|
794
|
+
/**
|
|
795
|
+
* Render `<GitHub repo="owner/name" />` repository cards.
|
|
796
|
+
* Pass an options object to configure fetching.
|
|
797
|
+
* @default true
|
|
798
|
+
*/
|
|
799
|
+
github?: boolean | GitHubOptions;
|
|
800
|
+
/**
|
|
801
|
+
* Render `<OgCard url="https://example.com" />` Open Graph link cards.
|
|
802
|
+
* Pass an options object to configure fetching.
|
|
803
|
+
* @default true
|
|
804
|
+
*/
|
|
805
|
+
openGraph?: boolean | OgpOptions;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Resolved built-in embed configuration.
|
|
809
|
+
*/
|
|
810
|
+
interface ResolvedBuiltinEmbedOptions {
|
|
811
|
+
github: GitHubOptions | false;
|
|
812
|
+
openGraph: OgpOptions | false;
|
|
813
|
+
}
|
|
541
814
|
/**
|
|
542
815
|
* Supported line annotation kinds for code blocks.
|
|
543
816
|
*/
|
|
@@ -1410,7 +1683,7 @@ interface MarkdownLintFileOptions extends MarkdownLintOptions {
|
|
|
1410
1683
|
cwd?: string;
|
|
1411
1684
|
/**
|
|
1412
1685
|
* Glob patterns for files to lint.
|
|
1413
|
-
* @default ['**\/*.md', '**\/*.markdown']
|
|
1686
|
+
* @default ['**\/*.md', '**\/*.markdown', '**\/*.mdx']
|
|
1414
1687
|
*/
|
|
1415
1688
|
include?: string[];
|
|
1416
1689
|
/**
|
|
@@ -1490,12 +1763,93 @@ declare function resolveSearchOptions(options: SearchOptions | boolean | undefin
|
|
|
1490
1763
|
/**
|
|
1491
1764
|
* Builds the search index from Markdown files.
|
|
1492
1765
|
*/
|
|
1493
|
-
declare function buildSearchIndex(srcDir: string, base: string): Promise<string>;
|
|
1766
|
+
declare function buildSearchIndex(srcDir: string, base: string, extensions?: readonly string[]): Promise<string>;
|
|
1494
1767
|
/**
|
|
1495
1768
|
* Writes the search index to a file.
|
|
1496
1769
|
*/
|
|
1497
1770
|
declare function writeSearchIndex(indexJson: string, outDir: string): Promise<void>;
|
|
1498
1771
|
//#endregion
|
|
1772
|
+
//#region src/markdown.d.ts
|
|
1773
|
+
declare const DEFAULT_MARKDOWN_EXTENSIONS: readonly [".md", ".markdown", ".mdx"];
|
|
1774
|
+
declare function normalizeMarkdownExtensions(extensions?: readonly string[]): string[];
|
|
1775
|
+
declare function isMarkdownFilePath(filePath: string, extensions?: readonly string[]): boolean;
|
|
1776
|
+
declare function stripMarkdownExtension(filePath: string, extensions?: readonly string[]): string;
|
|
1777
|
+
//#endregion
|
|
1778
|
+
//#region src/vitepress.d.ts
|
|
1779
|
+
interface VitePressLogo {
|
|
1780
|
+
light?: string;
|
|
1781
|
+
dark?: string;
|
|
1782
|
+
src?: string;
|
|
1783
|
+
alt?: string;
|
|
1784
|
+
}
|
|
1785
|
+
interface VitePressSocialLink {
|
|
1786
|
+
icon: string;
|
|
1787
|
+
link: string;
|
|
1788
|
+
ariaLabel?: string;
|
|
1789
|
+
}
|
|
1790
|
+
interface VitePressFooter {
|
|
1791
|
+
message?: string;
|
|
1792
|
+
copyright?: string;
|
|
1793
|
+
}
|
|
1794
|
+
interface VitePressSidebarItem {
|
|
1795
|
+
text?: string;
|
|
1796
|
+
link?: string;
|
|
1797
|
+
items?: VitePressSidebarItem[];
|
|
1798
|
+
collapsed?: boolean;
|
|
1799
|
+
}
|
|
1800
|
+
type VitePressSidebar = VitePressSidebarItem[] | Record<string, VitePressSidebarItem[]>;
|
|
1801
|
+
interface VitePressNavItem {
|
|
1802
|
+
text?: string;
|
|
1803
|
+
link?: string;
|
|
1804
|
+
items?: VitePressNavItem[];
|
|
1805
|
+
activeMatch?: string;
|
|
1806
|
+
}
|
|
1807
|
+
interface VitePressThemeConfig {
|
|
1808
|
+
siteTitle?: string | false;
|
|
1809
|
+
logo?: string | VitePressLogo;
|
|
1810
|
+
nav?: VitePressNavItem[];
|
|
1811
|
+
sidebar?: VitePressSidebar;
|
|
1812
|
+
socialLinks?: VitePressSocialLink[];
|
|
1813
|
+
footer?: VitePressFooter;
|
|
1814
|
+
search?: {
|
|
1815
|
+
placeholder?: string;
|
|
1816
|
+
};
|
|
1817
|
+
}
|
|
1818
|
+
interface VitePressConfig {
|
|
1819
|
+
title?: string;
|
|
1820
|
+
description?: string;
|
|
1821
|
+
base?: string;
|
|
1822
|
+
themeConfig?: VitePressThemeConfig;
|
|
1823
|
+
}
|
|
1824
|
+
interface GenerateVitePressMigrationConfigOptions {
|
|
1825
|
+
importSource?: string;
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Converts a VitePress sidebar config into ox-content navigation groups.
|
|
1829
|
+
* Nested VitePress items are flattened into the nearest ox-content group.
|
|
1830
|
+
*/
|
|
1831
|
+
declare function convertVitePressSidebar(sidebar: VitePressSidebar): SsgNavigationGroup[];
|
|
1832
|
+
/**
|
|
1833
|
+
* Converts VitePress top navigation into ox-content sidebar groups.
|
|
1834
|
+
* This is used as a fallback when no explicit sidebar is defined.
|
|
1835
|
+
*/
|
|
1836
|
+
declare function convertVitePressNav(nav: VitePressNavItem[]): SsgNavigationGroup[];
|
|
1837
|
+
/**
|
|
1838
|
+
* Creates ox-content plugin options from an existing VitePress config.
|
|
1839
|
+
*/
|
|
1840
|
+
declare function fromVitePressConfig(config: VitePressConfig, overrides?: OxContentOptions): OxContentOptions;
|
|
1841
|
+
/**
|
|
1842
|
+
* Generates a TypeScript module exporting migrated ox-content options.
|
|
1843
|
+
*
|
|
1844
|
+
* This is used by the migration CLI so users can inspect and edit the resulting
|
|
1845
|
+
* object instead of keeping a runtime dependency on their VitePress config.
|
|
1846
|
+
*/
|
|
1847
|
+
declare function generateVitePressMigrationConfig(config: VitePressConfig, overrides?: OxContentOptions, options?: GenerateVitePressMigrationConfigOptions): string;
|
|
1848
|
+
/**
|
|
1849
|
+
* Normalizes VitePress-specific frontmatter into ox-content's entry-page shape.
|
|
1850
|
+
*/
|
|
1851
|
+
declare function normalizeVitePressFrontmatter(frontmatter: Record<string, unknown>): Record<string, unknown>;
|
|
1852
|
+
//#endregion
|
|
1499
1853
|
//#region src/jsx-runtime.d.ts
|
|
1500
1854
|
/**
|
|
1501
1855
|
* Custom JSX Runtime for Static HTML Generation
|
|
@@ -1887,170 +2241,6 @@ declare function createTheme(config: {
|
|
|
1887
2241
|
defaultLayout?: string;
|
|
1888
2242
|
}): ThemeComponent;
|
|
1889
2243
|
//#endregion
|
|
1890
|
-
//#region src/plugins/tabs.d.ts
|
|
1891
|
-
/**
|
|
1892
|
-
* Transform Tabs components in HTML.
|
|
1893
|
-
*/
|
|
1894
|
-
declare function transformTabs(html: string): Promise<string>;
|
|
1895
|
-
/**
|
|
1896
|
-
* Generate dynamic CSS for :has() based tab switching.
|
|
1897
|
-
* This is needed because :has() selectors need unique IDs.
|
|
1898
|
-
*/
|
|
1899
|
-
declare function generateTabsCSS(groupCount: number): string;
|
|
1900
|
-
//#endregion
|
|
1901
|
-
//#region src/plugins/youtube.d.ts
|
|
1902
|
-
/**
|
|
1903
|
-
* YouTube Plugin - Privacy-enhanced iframe embedding
|
|
1904
|
-
*
|
|
1905
|
-
* Transforms <YouTube> components into responsive iframe embeds
|
|
1906
|
-
* using youtube-nocookie.com for enhanced privacy.
|
|
1907
|
-
*/
|
|
1908
|
-
interface YouTubeOptions {
|
|
1909
|
-
/** Use privacy-enhanced mode (youtube-nocookie.com). Default: true */
|
|
1910
|
-
privacyEnhanced?: boolean;
|
|
1911
|
-
/** Default aspect ratio. Default: "16/9" */
|
|
1912
|
-
aspectRatio?: string;
|
|
1913
|
-
/** Allow fullscreen. Default: true */
|
|
1914
|
-
allowFullscreen?: boolean;
|
|
1915
|
-
/** Lazy load iframe. Default: true */
|
|
1916
|
-
lazyLoad?: boolean;
|
|
1917
|
-
}
|
|
1918
|
-
/**
|
|
1919
|
-
* Extract YouTube video ID from various URL formats.
|
|
1920
|
-
*/
|
|
1921
|
-
declare function extractVideoId(input: string): string | null;
|
|
1922
|
-
/**
|
|
1923
|
-
* Transform YouTube components in HTML.
|
|
1924
|
-
*/
|
|
1925
|
-
declare function transformYouTube(html: string, options?: YouTubeOptions): Promise<string>;
|
|
1926
|
-
//#endregion
|
|
1927
|
-
//#region src/plugins/github.d.ts
|
|
1928
|
-
/**
|
|
1929
|
-
* GitHub Plugin - Repository card embedding
|
|
1930
|
-
*
|
|
1931
|
-
* Transforms <GitHub> components into static repository cards
|
|
1932
|
-
* by fetching data from GitHub API at build time.
|
|
1933
|
-
*/
|
|
1934
|
-
interface GitHubRepoData {
|
|
1935
|
-
name: string;
|
|
1936
|
-
full_name: string;
|
|
1937
|
-
description: string | null;
|
|
1938
|
-
html_url: string;
|
|
1939
|
-
stargazers_count: number;
|
|
1940
|
-
forks_count: number;
|
|
1941
|
-
language: string | null;
|
|
1942
|
-
owner: {
|
|
1943
|
-
login: string;
|
|
1944
|
-
avatar_url: string;
|
|
1945
|
-
};
|
|
1946
|
-
}
|
|
1947
|
-
interface GitHubOptions {
|
|
1948
|
-
/** GitHub API token for higher rate limits. */
|
|
1949
|
-
token?: string;
|
|
1950
|
-
/** Cache fetched data. Default: true */
|
|
1951
|
-
cache?: boolean;
|
|
1952
|
-
/** Cache TTL in milliseconds. Default: 3600000 (1 hour) */
|
|
1953
|
-
cacheTTL?: number;
|
|
1954
|
-
}
|
|
1955
|
-
/**
|
|
1956
|
-
* Fetch repository data from GitHub API.
|
|
1957
|
-
*/
|
|
1958
|
-
declare function fetchRepoData(repo: string, options: Required<GitHubOptions>): Promise<GitHubRepoData | null>;
|
|
1959
|
-
/**
|
|
1960
|
-
* Collect all GitHub repos from HTML for pre-fetching.
|
|
1961
|
-
*/
|
|
1962
|
-
declare function collectGitHubRepos(html: string): Promise<string[]>;
|
|
1963
|
-
/**
|
|
1964
|
-
* Pre-fetch all GitHub repos data.
|
|
1965
|
-
*/
|
|
1966
|
-
declare function prefetchGitHubRepos(repos: string[], options?: GitHubOptions): Promise<Map<string, GitHubRepoData | null>>;
|
|
1967
|
-
/**
|
|
1968
|
-
* Transform GitHub components in HTML.
|
|
1969
|
-
*/
|
|
1970
|
-
declare function transformGitHub(html: string, repoDataMap?: Map<string, GitHubRepoData | null>, options?: GitHubOptions): Promise<string>;
|
|
1971
|
-
//#endregion
|
|
1972
|
-
//#region src/plugins/ogp.d.ts
|
|
1973
|
-
/**
|
|
1974
|
-
* OGP Card Plugin - Link card embedding
|
|
1975
|
-
*
|
|
1976
|
-
* Transforms <OgCard> components into static link preview cards
|
|
1977
|
-
* by fetching OGP metadata at build time.
|
|
1978
|
-
*/
|
|
1979
|
-
interface OgpData {
|
|
1980
|
-
url: string;
|
|
1981
|
-
title: string;
|
|
1982
|
-
description?: string;
|
|
1983
|
-
image?: string;
|
|
1984
|
-
siteName?: string;
|
|
1985
|
-
favicon?: string;
|
|
1986
|
-
}
|
|
1987
|
-
interface OgpOptions {
|
|
1988
|
-
/** Request timeout in milliseconds. Default: 10000 */
|
|
1989
|
-
timeout?: number;
|
|
1990
|
-
/** Cache fetched data. Default: true */
|
|
1991
|
-
cache?: boolean;
|
|
1992
|
-
/** Cache TTL in milliseconds. Default: 3600000 (1 hour) */
|
|
1993
|
-
cacheTTL?: number;
|
|
1994
|
-
/** User agent for requests */
|
|
1995
|
-
userAgent?: string;
|
|
1996
|
-
}
|
|
1997
|
-
/**
|
|
1998
|
-
* Fetch OGP data for a URL.
|
|
1999
|
-
*/
|
|
2000
|
-
declare function fetchOgpData(url: string, options: Required<OgpOptions>): Promise<OgpData | null>;
|
|
2001
|
-
/**
|
|
2002
|
-
* Collect all OGP URLs from HTML for pre-fetching.
|
|
2003
|
-
*/
|
|
2004
|
-
declare function collectOgpUrls(html: string): Promise<string[]>;
|
|
2005
|
-
/**
|
|
2006
|
-
* Pre-fetch all OGP data.
|
|
2007
|
-
*/
|
|
2008
|
-
declare function prefetchOgpData(urls: string[], options?: OgpOptions): Promise<Map<string, OgpData | null>>;
|
|
2009
|
-
/**
|
|
2010
|
-
* Transform OgCard components in HTML.
|
|
2011
|
-
*/
|
|
2012
|
-
declare function transformOgp(html: string, ogpDataMap?: Map<string, OgpData | null>, options?: OgpOptions): Promise<string>;
|
|
2013
|
-
//#endregion
|
|
2014
|
-
//#region src/plugins/mermaid.d.ts
|
|
2015
|
-
/**
|
|
2016
|
-
* Mermaid Plugin - Native Rust renderer via NAPI
|
|
2017
|
-
*
|
|
2018
|
-
* Renders mermaid code blocks to SVG using the native Rust renderer
|
|
2019
|
-
* via NAPI. Delegates to the NAPI `transformMermaid` function which
|
|
2020
|
-
* extracts mermaid code blocks from HTML and renders them using mmdc.
|
|
2021
|
-
*/
|
|
2022
|
-
interface MermaidOptions {
|
|
2023
|
-
/** Mermaid theme. Default: "neutral" */
|
|
2024
|
-
theme?: "default" | "dark" | "forest" | "neutral" | "base";
|
|
2025
|
-
}
|
|
2026
|
-
/**
|
|
2027
|
-
* Transforms mermaid code blocks in HTML to rendered SVG diagrams.
|
|
2028
|
-
* Uses the native Rust NAPI transformMermaid function.
|
|
2029
|
-
*/
|
|
2030
|
-
declare function transformMermaidStatic(html: string, _options?: MermaidOptions): Promise<string>;
|
|
2031
|
-
/**
|
|
2032
|
-
* @deprecated No longer used. Mermaid rendering is now done at build time via NAPI.
|
|
2033
|
-
*/
|
|
2034
|
-
declare const mermaidClientScript = "";
|
|
2035
|
-
//#endregion
|
|
2036
|
-
//#region src/plugins/index.d.ts
|
|
2037
|
-
/**
|
|
2038
|
-
* Transform all plugin components in HTML.
|
|
2039
|
-
* Call this during SSG build to process all plugins at once.
|
|
2040
|
-
*/
|
|
2041
|
-
interface TransformAllOptions {
|
|
2042
|
-
tabs?: boolean;
|
|
2043
|
-
youtube?: boolean;
|
|
2044
|
-
github?: boolean;
|
|
2045
|
-
ogp?: boolean;
|
|
2046
|
-
mermaid?: boolean;
|
|
2047
|
-
githubToken?: string;
|
|
2048
|
-
}
|
|
2049
|
-
/**
|
|
2050
|
-
* Transform all enabled plugins in HTML content.
|
|
2051
|
-
*/
|
|
2052
|
-
declare function transformAllPlugins(html: string, options?: TransformAllOptions): Promise<string>;
|
|
2053
|
-
//#endregion
|
|
2054
2244
|
//#region src/island/parse.d.ts
|
|
2055
2245
|
/**
|
|
2056
2246
|
* Island Parser
|
|
@@ -2265,10 +2455,11 @@ declare function createI18nPlugin(resolvedOptions: ResolvedOptions): Plugin;
|
|
|
2265
2455
|
* ```
|
|
2266
2456
|
*/
|
|
2267
2457
|
declare function oxContent(options?: OxContentOptions): Plugin[];
|
|
2458
|
+
declare function resolveBuiltinEmbedOptions(options: OxContentOptions["embeds"]): ResolvedOptions["embeds"];
|
|
2268
2459
|
/**
|
|
2269
2460
|
* Generates virtual module content.
|
|
2270
2461
|
*/
|
|
2271
2462
|
declare function generateVirtualModule(path: string, options: ResolvedOptions): string;
|
|
2272
2463
|
//#endregion
|
|
2273
|
-
export { type BasePageProps, CodeAnnotationKind, type CodeAnnotationSyntax, type CodeAnnotationsOptions, DEFAULT_HTML_TEMPLATE, DefaultTheme, type DocEntry, type DocsOptions, DocsSummary, type EntryPageConfig, type ExtractedDocs, type FeatureConfig, Fragment, type FrontmatterSchema, GeneratedDocsData, type GitHubOptions, type GitHubRepoData, type HeroAction, type HeroConfig, type HeroImage, HeroNotice, type I18nOptions, type IslandInfo, type JSXChild, type JSXElementType, type JSXNode, type JSXProps, type LanguageRegistration, type LoadStrategy, type LocaleConfig, type MarkdownLintFileDiagnostic as MarkdownLintBatchDiagnostic, type MarkdownLintFileDiagnostic, type MarkdownLintDiagnostic, type MarkdownLintDictionaryOptions, type MarkdownLintFileOptions, type MarkdownLintFileOptions as MarkdownLintProjectOptions, type MarkdownLintFileResult, type MarkdownLintFilesResult, type MarkdownLintLanguage, type MarkdownLintOptions, type MarkdownLintResult, type MarkdownLintRuleOptions, type MarkdownLintSeverity, type MarkdownLintStandardDictionaryOptions, MarkdownNode, MarkdownTransformer, type MermaidOptions, type NavGroup, type NavItem, type OgBrowserSession, type OgImageOptions, type OgImagePageEntry, type OgImageOptions$1 as OgImagePluginOptions, type OgImageResult, type OgImageTemplateFn, type OgImageTemplateProps, type OgpData, type OgpOptions, type OxContentOptions, type PageData, type PageProps, type ParamDoc, type ParseIslandsResult, type RenderContext, type ResolvedCodeAnnotationsOptions, type ResolvedDocsOptions, type ResolvedI18nOptions, type ResolvedOgImageOptions, ResolvedOptions, type ResolvedSearchOptions, type ResolvedSsgOptions, type ResolvedThemeConfig, type ReturnDoc, ScopedSearchQuery, type SearchDocument, type SearchOptions, type SearchResult, type SiteConfig, type SocialLinks, type SsgOptions, type ThemeColors, type ThemeComponent, type ThemeConfig, type ThemeEmbed, type ThemeEntryPage, type ThemeFonts, type ThemeFooter, type ThemeHeader, type ThemeLayout, type ThemeProps, type ThemeRegistration, type ThemeRenderOptions, TocEntry, type TransformAllOptions, TransformContext, TransformResult, type YouTubeOptions, buildSearchIndex, buildSsg, clearRenderContext, collectGitHubRepos, collectOgpUrls, createI18nPlugin, createMarkdownEnvironment, createTheme, defaultTheme, defineTheme, each, extractDocs, extractIslandInfo, extractVideoId, fetchOgpData, fetchRepoData, generateFrontmatterTypes, generateHydrationScript, generateMarkdown, generateOgImages, generateTabsCSS, generateTypes, generateVirtualModule, hasIslands, inferType, jsx, jsxs, lintMarkdown, lintMarkdownAsync, lintMarkdownFile, lintMarkdownFiles, mergeThemes, mermaidClientScript, oxContent, prefetchGitHubRepos, prefetchOgpData, raw, renderAllPages, renderPage, renderToString, resolveDocsOptions, resolveI18nOptions, resolveOgImageOptions, resolveSearchOptions, resolveSsgOptions, resolveTheme, setRenderContext, shouldLintMarkdownFile, transformAllPlugins, transformGitHub, transformIslands, transformMarkdown, transformMermaidStatic, transformOgp, transformTabs, transformYouTube, useIsActive, useNav, usePageProps, useRenderContext, useSiteConfig, when, writeDocs, writeSearchIndex };
|
|
2464
|
+
export { type BasePageProps, type BuiltinEmbedOptions, CodeAnnotationKind, type CodeAnnotationSyntax, type CodeAnnotationsOptions, DEFAULT_HTML_TEMPLATE, DEFAULT_MARKDOWN_EXTENSIONS, DefaultTheme, type DocEntry, type DocsOptions, DocsSummary, type EntryPageConfig, type ExtractedDocs, type FeatureConfig, Fragment, type FrontmatterSchema, type GenerateVitePressMigrationConfigOptions, GeneratedDocsData, type GitHubLineRange, type GitHubOptions, type GitHubRepoData, type GitHubSourceData, type GitHubSourceRef, type HeroAction, type HeroConfig, type HeroImage, HeroNotice, type I18nOptions, type IslandInfo, type JSXChild, type JSXElementType, type JSXNode, type JSXProps, type LanguageRegistration, type LoadStrategy, type LocaleConfig, type MarkdownLintFileDiagnostic as MarkdownLintBatchDiagnostic, type MarkdownLintFileDiagnostic, type MarkdownLintDiagnostic, type MarkdownLintDictionaryOptions, type MarkdownLintFileOptions, type MarkdownLintFileOptions as MarkdownLintProjectOptions, type MarkdownLintFileResult, type MarkdownLintFilesResult, type MarkdownLintLanguage, type MarkdownLintOptions, type MarkdownLintResult, type MarkdownLintRuleOptions, type MarkdownLintSeverity, type MarkdownLintStandardDictionaryOptions, MarkdownNode, MarkdownTransformer, type MermaidOptions, type NavGroup, type NavItem, type OgBrowserSession, type OgImageOptions, type OgImagePageEntry, type OgImageOptions$1 as OgImagePluginOptions, type OgImageResult, type OgImageTemplateFn, type OgImageTemplateProps, type OgpData, type OgpOptions, type OxContentOptions, type PageData, type PageProps, type ParamDoc, type ParseIslandsResult, type RenderContext, type ResolvedBuiltinEmbedOptions, type ResolvedCodeAnnotationsOptions, type ResolvedDocsOptions, type ResolvedI18nOptions, type ResolvedOgImageOptions, ResolvedOptions, type ResolvedSearchOptions, type ResolvedSsgOptions, type ResolvedThemeConfig, type ReturnDoc, ScopedSearchQuery, type SearchDocument, type SearchOptions, type SearchResult, type SiteConfig, type SocialLinks, type SsgNavigationGroup, type SsgNavigationItem, type SsgOptions, type ThemeColors, type ThemeComponent, type ThemeConfig, type ThemeEmbed, type ThemeEntryPage, type ThemeFonts, type ThemeFooter, type ThemeHeader, type ThemeLayout, type ThemeProps, type ThemeRegistration, type ThemeRenderOptions, TocEntry, type TransformAllOptions, TransformContext, TransformResult, type VitePressConfig, type VitePressFooter, type VitePressLogo, type VitePressNavItem, type VitePressSidebar, type VitePressSidebarItem, type VitePressSocialLink, type VitePressThemeConfig, type YouTubeOptions, buildSearchIndex, buildSsg, clearRenderContext, collectGitHubRepos, collectGitHubSources, collectOgpUrls, convertVitePressNav, convertVitePressSidebar, createI18nPlugin, createMarkdownEnvironment, createTheme, defaultTheme, defineTheme, each, extractDocs, extractIslandInfo, extractVideoId, fetchGitHubSource, fetchOgpData, fetchRepoData, fromVitePressConfig, generateFrontmatterTypes, generateHydrationScript, generateMarkdown, generateOgImages, generateTabsCSS, generateTypes, generateVirtualModule, generateVitePressMigrationConfig, hasIslands, inferType, isMarkdownFilePath, jsx, jsxs, lintMarkdown, lintMarkdownAsync, lintMarkdownFile, lintMarkdownFiles, mergeThemes, mermaidClientScript, normalizeMarkdownExtensions, normalizeVitePressFrontmatter, oxContent, parseGitHubLineRange, parseGitHubPermalink, prefetchGitHubRepos, prefetchGitHubSources, prefetchOgpData, raw, renderAllPages, renderPage, renderToString, resolveBuiltinEmbedOptions, resolveDocsOptions, resolveI18nOptions, resolveOgImageOptions, resolveSearchOptions, resolveSsgOptions, resolveTheme, setRenderContext, shouldLintMarkdownFile, stripMarkdownExtension, transformAllPlugins, transformGitHub, transformIslands, transformMarkdown, transformMermaidStatic, transformOgp, transformTabs, transformYouTube, useIsActive, useNav, usePageProps, useRenderContext, useSiteConfig, when, writeDocs, writeSearchIndex };
|
|
2274
2465
|
//# sourceMappingURL=index.d.mts.map
|