boltdocs 1.3.0 → 1.3.2

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.
Files changed (103) hide show
  1. package/dist/{cache-EHR7SXRU.mjs → cache-GQHF6BXI.mjs} +1 -1
  2. package/dist/{chunk-GSYECEZY.mjs → chunk-CYBWLFOG.mjs} +5 -1
  3. package/dist/node/index.js +36 -20
  4. package/dist/node/index.mjs +34 -22
  5. package/package.json +1 -1
  6. package/src/client/app/index.tsx +344 -344
  7. package/src/client/app/preload.tsx +56 -56
  8. package/src/client/index.ts +40 -40
  9. package/src/client/ssr.tsx +51 -51
  10. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +76 -76
  11. package/src/client/theme/components/CodeBlock/index.ts +1 -1
  12. package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +154 -154
  13. package/src/client/theme/components/PackageManagerTabs/index.ts +1 -1
  14. package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +64 -64
  15. package/src/client/theme/components/Playground/Playground.tsx +124 -124
  16. package/src/client/theme/components/Playground/index.ts +1 -1
  17. package/src/client/theme/components/Playground/playground.css +168 -168
  18. package/src/client/theme/components/Video/Video.tsx +84 -84
  19. package/src/client/theme/components/Video/index.ts +1 -1
  20. package/src/client/theme/components/Video/video.css +41 -41
  21. package/src/client/theme/components/mdx/Admonition.tsx +80 -80
  22. package/src/client/theme/components/mdx/Badge.tsx +31 -31
  23. package/src/client/theme/components/mdx/Button.tsx +50 -50
  24. package/src/client/theme/components/mdx/Card.tsx +80 -80
  25. package/src/client/theme/components/mdx/List.tsx +57 -57
  26. package/src/client/theme/components/mdx/Tabs.tsx +94 -94
  27. package/src/client/theme/components/mdx/index.ts +18 -18
  28. package/src/client/theme/components/mdx/mdx-components.css +424 -424
  29. package/src/client/theme/icons/bun.tsx +62 -62
  30. package/src/client/theme/icons/deno.tsx +20 -20
  31. package/src/client/theme/icons/discord.tsx +12 -12
  32. package/src/client/theme/icons/github.tsx +15 -15
  33. package/src/client/theme/icons/npm.tsx +13 -13
  34. package/src/client/theme/icons/pnpm.tsx +72 -72
  35. package/src/client/theme/icons/twitter.tsx +12 -12
  36. package/src/client/theme/styles/markdown.css +343 -343
  37. package/src/client/theme/styles/variables.css +162 -162
  38. package/src/client/theme/styles.css +37 -37
  39. package/src/client/theme/ui/BackgroundGradient/BackgroundGradient.tsx +10 -10
  40. package/src/client/theme/ui/BackgroundGradient/index.ts +1 -1
  41. package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +68 -68
  42. package/src/client/theme/ui/Breadcrumbs/index.ts +1 -1
  43. package/src/client/theme/ui/Footer/footer.css +32 -32
  44. package/src/client/theme/ui/Head/Head.tsx +69 -69
  45. package/src/client/theme/ui/Head/index.ts +1 -1
  46. package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +125 -125
  47. package/src/client/theme/ui/LanguageSwitcher/index.ts +1 -1
  48. package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +98 -98
  49. package/src/client/theme/ui/Layout/Layout.tsx +202 -202
  50. package/src/client/theme/ui/Layout/base.css +76 -76
  51. package/src/client/theme/ui/Layout/index.ts +2 -2
  52. package/src/client/theme/ui/Layout/pagination.css +72 -72
  53. package/src/client/theme/ui/Layout/responsive.css +36 -36
  54. package/src/client/theme/ui/Link/Link.tsx +254 -254
  55. package/src/client/theme/ui/Link/index.ts +2 -2
  56. package/src/client/theme/ui/Loading/Loading.tsx +10 -10
  57. package/src/client/theme/ui/Loading/index.ts +1 -1
  58. package/src/client/theme/ui/Loading/loading.css +30 -30
  59. package/src/client/theme/ui/Navbar/GithubStars.tsx +27 -27
  60. package/src/client/theme/ui/Navbar/Navbar.tsx +145 -145
  61. package/src/client/theme/ui/Navbar/index.ts +2 -2
  62. package/src/client/theme/ui/Navbar/navbar.css +233 -233
  63. package/src/client/theme/ui/NotFound/NotFound.tsx +19 -19
  64. package/src/client/theme/ui/NotFound/index.ts +1 -1
  65. package/src/client/theme/ui/NotFound/not-found.css +64 -64
  66. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +235 -235
  67. package/src/client/theme/ui/OnThisPage/index.ts +1 -1
  68. package/src/client/theme/ui/OnThisPage/toc.css +132 -132
  69. package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +18 -18
  70. package/src/client/theme/ui/PoweredBy/index.ts +1 -1
  71. package/src/client/theme/ui/PoweredBy/powered-by.css +76 -76
  72. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +199 -199
  73. package/src/client/theme/ui/SearchDialog/index.ts +1 -1
  74. package/src/client/theme/ui/SearchDialog/search.css +152 -152
  75. package/src/client/theme/ui/Sidebar/Sidebar.tsx +204 -204
  76. package/src/client/theme/ui/Sidebar/index.ts +1 -1
  77. package/src/client/theme/ui/Sidebar/sidebar.css +236 -236
  78. package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +69 -69
  79. package/src/client/theme/ui/ThemeToggle/index.ts +1 -1
  80. package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +136 -136
  81. package/src/client/theme/ui/VersionSwitcher/index.ts +1 -1
  82. package/src/client/types.ts +50 -50
  83. package/src/client/utils.ts +26 -26
  84. package/src/node/cache.ts +408 -408
  85. package/src/node/config.ts +192 -192
  86. package/src/node/index.ts +21 -21
  87. package/src/node/mdx.ts +120 -120
  88. package/src/node/plugin/entry.ts +58 -58
  89. package/src/node/plugin/html.ts +55 -55
  90. package/src/node/plugin/index.ts +193 -193
  91. package/src/node/plugin/types.ts +11 -11
  92. package/src/node/routes/cache.ts +28 -28
  93. package/src/node/routes/index.ts +167 -167
  94. package/src/node/routes/parser.ts +153 -127
  95. package/src/node/routes/sorter.ts +42 -42
  96. package/src/node/routes/types.ts +49 -49
  97. package/src/node/ssg/index.ts +114 -114
  98. package/src/node/ssg/meta.ts +33 -34
  99. package/src/node/ssg/options.ts +13 -13
  100. package/src/node/ssg/sitemap.ts +55 -54
  101. package/src/node/utils.ts +145 -134
  102. package/tsconfig.json +20 -20
  103. package/tsup.config.ts +22 -22
@@ -1,127 +1,153 @@
1
- import path from "path";
2
- import GithubSlugger from "github-slugger";
3
- import { BoltdocsConfig } from "../config";
4
- import { ParsedDocFile } from "./types";
5
- import {
6
- normalizePath,
7
- parseFrontmatter,
8
- fileToRoutePath,
9
- capitalize,
10
- stripNumberPrefix,
11
- extractNumberPrefix,
12
- } from "../utils";
13
-
14
- /**
15
- * Parses a single Markdown/MDX file and extracts its metadata for routing.
16
- * Checks frontmatter for explicit titles, descriptions, and sidebar positions.
17
- *
18
- * @param file - The absolute path to the file
19
- * @param docsDir - The root documentation directory (e.g., 'docs')
20
- * @param basePath - The base URL path for the routes (default: '/docs')
21
- * @returns A parsed structure ready for route assembly and caching
22
- */
23
- export function parseDocFile(
24
- file: string,
25
- docsDir: string,
26
- basePath: string,
27
- config?: BoltdocsConfig,
28
- ): ParsedDocFile {
29
- const { data, content } = parseFrontmatter(file);
30
- const relativePath = normalizePath(path.relative(docsDir, file));
31
- let parts = relativePath.split("/");
32
-
33
- let locale: string | undefined;
34
- let version: string | undefined;
35
-
36
- // Level 1: Check for version
37
- if (config?.versions && parts.length > 0) {
38
- const potentialVersion = parts[0];
39
- if (config.versions.versions[potentialVersion]) {
40
- version = potentialVersion;
41
- parts = parts.slice(1);
42
- }
43
- }
44
-
45
- // Level 2: Check for locale
46
- if (config?.i18n && parts.length > 0) {
47
- const potentialLocale = parts[0];
48
- if (config.i18n.locales[potentialLocale]) {
49
- locale = potentialLocale;
50
- parts = parts.slice(1);
51
- }
52
- }
53
-
54
- const cleanRelativePath = parts.join("/");
55
- const cleanRoutePath = fileToRoutePath(cleanRelativePath || "index.md");
56
-
57
- let finalPath = basePath;
58
- if (version) {
59
- finalPath += "/" + version;
60
- }
61
- if (locale) {
62
- finalPath += "/" + locale;
63
- }
64
- finalPath += cleanRoutePath === "/" ? "" : cleanRoutePath;
65
-
66
- if (!finalPath || finalPath === "") finalPath = "/";
67
-
68
- const rawFileName = parts[parts.length - 1];
69
- const cleanFileName = stripNumberPrefix(rawFileName);
70
- const inferredTitle = stripNumberPrefix(
71
- path.basename(file, path.extname(file)),
72
- );
73
- const sidebarPosition =
74
- data.sidebarPosition ?? extractNumberPrefix(rawFileName);
75
-
76
- const rawDirName = parts.length >= 2 ? parts[0] : undefined;
77
- const cleanDirName = rawDirName ? stripNumberPrefix(rawDirName) : undefined;
78
-
79
- const isGroupIndex = parts.length >= 2 && /^index\.mdx?$/.test(cleanFileName);
80
-
81
- const headings: { level: number; text: string; id: string }[] = [];
82
- const slugger = new GithubSlugger();
83
- const headingsRegex = /^(#{2,4})\s+(.+)$/gm;
84
- let match;
85
- while ((match = headingsRegex.exec(content)) !== null) {
86
- const level = match[1].length;
87
- // Strip simple markdown formatting specifically for the plain-text search index
88
- const text = match[2]
89
- .replace(/\[([^\]]+)\]\([^\)]+\)/g, "$1")
90
- .replace(/[_*`]/g, "")
91
- .trim();
92
- const id = slugger.slug(text);
93
- headings.push({ level, text, id });
94
- }
95
-
96
- return {
97
- route: {
98
- path: finalPath,
99
- componentPath: file,
100
- filePath: relativePath,
101
- title: data.title || inferredTitle,
102
- description: data.description || "",
103
- sidebarPosition,
104
- headings,
105
- locale,
106
- version,
107
- badge: data.badge,
108
- },
109
- relativeDir: cleanDirName,
110
- isGroupIndex,
111
- groupMeta: isGroupIndex
112
- ? {
113
- title:
114
- data.groupTitle ||
115
- data.title ||
116
- (cleanDirName ? capitalize(cleanDirName) : ""),
117
- position:
118
- data.groupPosition ??
119
- data.sidebarPosition ??
120
- (rawDirName ? extractNumberPrefix(rawDirName) : undefined),
121
- }
122
- : undefined,
123
- inferredGroupPosition: rawDirName
124
- ? extractNumberPrefix(rawDirName)
125
- : undefined,
126
- };
127
- }
1
+ import path from "path";
2
+ import GithubSlugger from "github-slugger";
3
+ import { BoltdocsConfig } from "../config";
4
+ import { ParsedDocFile } from "./types";
5
+ import {
6
+ normalizePath,
7
+ parseFrontmatter,
8
+ fileToRoutePath,
9
+ capitalize,
10
+ stripNumberPrefix,
11
+ extractNumberPrefix,
12
+ escapeHtml,
13
+ } from "../utils";
14
+
15
+ /**
16
+ * Parses a single Markdown/MDX file and extracts its metadata for routing.
17
+ * Checks frontmatter for explicit titles, descriptions, and sidebar positions.
18
+ *
19
+ * @param file - The absolute path to the file
20
+ * @param docsDir - The root documentation directory (e.g., 'docs')
21
+ * @param basePath - The base URL path for the routes (default: '/docs')
22
+ * @returns A parsed structure ready for route assembly and caching
23
+ */
24
+ export function parseDocFile(
25
+ file: string,
26
+ docsDir: string,
27
+ basePath: string,
28
+ config?: BoltdocsConfig,
29
+ ): ParsedDocFile {
30
+ // Security: Prevent path traversal
31
+ const decodedFile = decodeURIComponent(file);
32
+ const absoluteFile = path.resolve(decodedFile);
33
+ const absoluteDocsDir = path.resolve(docsDir);
34
+ const relativePath = normalizePath(
35
+ path.relative(absoluteDocsDir, absoluteFile),
36
+ );
37
+
38
+ if (
39
+ relativePath.startsWith("../") ||
40
+ relativePath === ".." ||
41
+ absoluteFile.includes("\0")
42
+ ) {
43
+ throw new Error(
44
+ `Security breach: File is outside of docs directory or contains null bytes: ${file}`,
45
+ );
46
+ }
47
+
48
+ const { data, content } = parseFrontmatter(file);
49
+ let parts = relativePath.split("/");
50
+
51
+ let locale: string | undefined;
52
+ let version: string | undefined;
53
+
54
+ // Level 1: Check for version
55
+ if (config?.versions && parts.length > 0) {
56
+ const potentialVersion = parts[0];
57
+ if (config.versions.versions[potentialVersion]) {
58
+ version = potentialVersion;
59
+ parts = parts.slice(1);
60
+ }
61
+ }
62
+
63
+ // Level 2: Check for locale
64
+ if (config?.i18n && parts.length > 0) {
65
+ const potentialLocale = parts[0];
66
+ if (config.i18n.locales[potentialLocale]) {
67
+ locale = potentialLocale;
68
+ parts = parts.slice(1);
69
+ }
70
+ }
71
+
72
+ const cleanRelativePath = parts.join("/");
73
+ const cleanRoutePath = fileToRoutePath(cleanRelativePath || "index.md");
74
+
75
+ let finalPath = basePath;
76
+ if (version) {
77
+ finalPath += "/" + version;
78
+ }
79
+ if (locale) {
80
+ finalPath += "/" + locale;
81
+ }
82
+ finalPath += cleanRoutePath === "/" ? "" : cleanRoutePath;
83
+
84
+ if (!finalPath || finalPath === "") finalPath = "/";
85
+
86
+ const rawFileName = parts[parts.length - 1];
87
+ const cleanFileName = stripNumberPrefix(rawFileName);
88
+ const inferredTitle = stripNumberPrefix(
89
+ path.basename(file, path.extname(file)),
90
+ );
91
+ const sidebarPosition =
92
+ data.sidebarPosition ?? extractNumberPrefix(rawFileName);
93
+
94
+ const rawDirName = parts.length >= 2 ? parts[0] : undefined;
95
+ const cleanDirName = rawDirName ? stripNumberPrefix(rawDirName) : undefined;
96
+
97
+ const isGroupIndex = parts.length >= 2 && /^index\.mdx?$/.test(cleanFileName);
98
+
99
+ const headings: { level: number; text: string; id: string }[] = [];
100
+ const slugger = new GithubSlugger();
101
+ const headingsRegex = /^(#{2,4})\s+(.+)$/gm;
102
+ let match;
103
+ while ((match = headingsRegex.exec(content)) !== null) {
104
+ const level = match[1].length;
105
+ // Strip simple markdown formatting specifically for the plain-text search index
106
+ const text = match[2]
107
+ .replace(/\[([^\]]+)\]\([^\)]+\)/g, "$1")
108
+ .replace(/[_*`]/g, "")
109
+ .trim();
110
+ const id = slugger.slug(text);
111
+ // Security: Sanitize heading text for XSS
112
+ headings.push({ level, text: escapeHtml(text), id });
113
+ }
114
+
115
+ const sanitizedTitle = data.title ? escapeHtml(data.title) : inferredTitle;
116
+ const sanitizedDescription = data.description
117
+ ? escapeHtml(data.description)
118
+ : "";
119
+ const sanitizedBadge = data.badge ? escapeHtml(data.badge) : undefined;
120
+
121
+ return {
122
+ route: {
123
+ path: finalPath,
124
+ componentPath: file,
125
+ filePath: relativePath,
126
+ title: sanitizedTitle,
127
+ description: sanitizedDescription,
128
+ sidebarPosition,
129
+ headings,
130
+ locale,
131
+ version,
132
+ badge: sanitizedBadge,
133
+ },
134
+ relativeDir: cleanDirName,
135
+ isGroupIndex,
136
+ groupMeta: isGroupIndex
137
+ ? {
138
+ title: escapeHtml(
139
+ data.groupTitle ||
140
+ data.title ||
141
+ (cleanDirName ? capitalize(cleanDirName) : ""),
142
+ ),
143
+ position:
144
+ data.groupPosition ??
145
+ data.sidebarPosition ??
146
+ (rawDirName ? extractNumberPrefix(rawDirName) : undefined),
147
+ }
148
+ : undefined,
149
+ inferredGroupPosition: rawDirName
150
+ ? extractNumberPrefix(rawDirName)
151
+ : undefined,
152
+ };
153
+ }
@@ -1,42 +1,42 @@
1
- import { RouteMeta } from "./types";
2
-
3
- /**
4
- * Sorts an array of generated routes.
5
- * Ungrouped items come first. Items within the same group are sorted by position, then alphabetically.
6
- * Groups are sorted relative to each other by their group position, then alphabetically.
7
- *
8
- * @param routes - The unsorted routes
9
- * @returns A new array of sorted routes suitable for sidebar generation
10
- */
11
- export function sortRoutes(routes: RouteMeta[]): RouteMeta[] {
12
- return routes.sort((a, b) => {
13
- // Ungrouped first
14
- if (!a.group && !b.group) return compareByPosition(a, b);
15
- if (!a.group) return -1;
16
- if (!b.group) return 1;
17
-
18
- // Different groups: sort by group position
19
- if (a.group !== b.group) {
20
- return compareByGroupPosition(a, b);
21
- }
22
-
23
- // Same group: sort by item position
24
- return compareByPosition(a, b);
25
- });
26
- }
27
-
28
- function compareByPosition(a: RouteMeta, b: RouteMeta): number {
29
- if (a.sidebarPosition !== undefined && b.sidebarPosition !== undefined)
30
- return a.sidebarPosition - b.sidebarPosition;
31
- if (a.sidebarPosition !== undefined) return -1;
32
- if (b.sidebarPosition !== undefined) return 1;
33
- return a.title.localeCompare(b.title);
34
- }
35
-
36
- function compareByGroupPosition(a: RouteMeta, b: RouteMeta): number {
37
- if (a.groupPosition !== undefined && b.groupPosition !== undefined)
38
- return a.groupPosition - b.groupPosition;
39
- if (a.groupPosition !== undefined) return -1;
40
- if (b.groupPosition !== undefined) return 1;
41
- return (a.groupTitle || a.group!).localeCompare(b.groupTitle || b.group!);
42
- }
1
+ import { RouteMeta } from "./types";
2
+
3
+ /**
4
+ * Sorts an array of generated routes.
5
+ * Ungrouped items come first. Items within the same group are sorted by position, then alphabetically.
6
+ * Groups are sorted relative to each other by their group position, then alphabetically.
7
+ *
8
+ * @param routes - The unsorted routes
9
+ * @returns A new array of sorted routes suitable for sidebar generation
10
+ */
11
+ export function sortRoutes(routes: RouteMeta[]): RouteMeta[] {
12
+ return routes.sort((a, b) => {
13
+ // Ungrouped first
14
+ if (!a.group && !b.group) return compareByPosition(a, b);
15
+ if (!a.group) return -1;
16
+ if (!b.group) return 1;
17
+
18
+ // Different groups: sort by group position
19
+ if (a.group !== b.group) {
20
+ return compareByGroupPosition(a, b);
21
+ }
22
+
23
+ // Same group: sort by item position
24
+ return compareByPosition(a, b);
25
+ });
26
+ }
27
+
28
+ function compareByPosition(a: RouteMeta, b: RouteMeta): number {
29
+ if (a.sidebarPosition !== undefined && b.sidebarPosition !== undefined)
30
+ return a.sidebarPosition - b.sidebarPosition;
31
+ if (a.sidebarPosition !== undefined) return -1;
32
+ if (b.sidebarPosition !== undefined) return 1;
33
+ return a.title.localeCompare(b.title);
34
+ }
35
+
36
+ function compareByGroupPosition(a: RouteMeta, b: RouteMeta): number {
37
+ if (a.groupPosition !== undefined && b.groupPosition !== undefined)
38
+ return a.groupPosition - b.groupPosition;
39
+ if (a.groupPosition !== undefined) return -1;
40
+ if (b.groupPosition !== undefined) return 1;
41
+ return (a.groupTitle || a.group!).localeCompare(b.groupTitle || b.group!);
42
+ }
@@ -1,49 +1,49 @@
1
- /**
2
- * Metadata representing a single documentation route.
3
- * This information is used to build the client-side router and the sidebar navigation.
4
- */
5
- export interface RouteMeta {
6
- /** The final URL path for the route (e.g., '/docs/guide/start') */
7
- path: string;
8
- /** The absolute filesystem path to the source markdown/mdx file */
9
- componentPath: string;
10
- /** The title of the page, usually extracted from frontmatter or the filename */
11
- title: string;
12
- /** The relative path from the docs directory, used for edit links */
13
- filePath: string;
14
- /** Optional description of the page (for SEO/meta tags) */
15
- description?: string;
16
- /** Optional explicit position for ordering in the sidebar */
17
- sidebarPosition?: number;
18
- /** The group (directory) this route belongs to */
19
- group?: string;
20
- /** The display title for the route's group */
21
- groupTitle?: string;
22
- /** Optional explicit position for ordering the group itself */
23
- groupPosition?: number;
24
- /** Extracted markdown headings for search indexing */
25
- headings?: { level: number; text: string; id: string }[];
26
- /** The locale this route belongs to, if i18n is configured */
27
- locale?: string;
28
- /** The version this route belongs to, if versioning is configured */
29
- version?: string;
30
- /** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
31
- badge?: string | { text: string; expires?: string };
32
- }
33
-
34
- /**
35
- * Internal representation of a parsed documentation file before finalizing groups.
36
- * Stored in the file cache to avoid re-parsing unchanged files.
37
- */
38
- export interface ParsedDocFile {
39
- /** The core route metadata without group-level details (inferred later) */
40
- route: Omit<RouteMeta, "group" | "groupTitle" | "groupPosition">;
41
- /** The base directory of the file (used to group files together) */
42
- relativeDir?: string;
43
- /** Whether this file is the index file for its directory group */
44
- isGroupIndex: boolean;
45
- /** If this is a group index, any specific frontmatter metadata dictating the group's title and position */
46
- groupMeta?: { title: string; position?: number };
47
- /** Extracted group position from the directory name if it has a numeric prefix */
48
- inferredGroupPosition?: number;
49
- }
1
+ /**
2
+ * Metadata representing a single documentation route.
3
+ * This information is used to build the client-side router and the sidebar navigation.
4
+ */
5
+ export interface RouteMeta {
6
+ /** The final URL path for the route (e.g., '/docs/guide/start') */
7
+ path: string;
8
+ /** The absolute filesystem path to the source markdown/mdx file */
9
+ componentPath: string;
10
+ /** The title of the page, usually extracted from frontmatter or the filename */
11
+ title: string;
12
+ /** The relative path from the docs directory, used for edit links */
13
+ filePath: string;
14
+ /** Optional description of the page (for SEO/meta tags) */
15
+ description?: string;
16
+ /** Optional explicit position for ordering in the sidebar */
17
+ sidebarPosition?: number;
18
+ /** The group (directory) this route belongs to */
19
+ group?: string;
20
+ /** The display title for the route's group */
21
+ groupTitle?: string;
22
+ /** Optional explicit position for ordering the group itself */
23
+ groupPosition?: number;
24
+ /** Extracted markdown headings for search indexing */
25
+ headings?: { level: number; text: string; id: string }[];
26
+ /** The locale this route belongs to, if i18n is configured */
27
+ locale?: string;
28
+ /** The version this route belongs to, if versioning is configured */
29
+ version?: string;
30
+ /** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
31
+ badge?: string | { text: string; expires?: string };
32
+ }
33
+
34
+ /**
35
+ * Internal representation of a parsed documentation file before finalizing groups.
36
+ * Stored in the file cache to avoid re-parsing unchanged files.
37
+ */
38
+ export interface ParsedDocFile {
39
+ /** The core route metadata without group-level details (inferred later) */
40
+ route: Omit<RouteMeta, "group" | "groupTitle" | "groupPosition">;
41
+ /** The base directory of the file (used to group files together) */
42
+ relativeDir?: string;
43
+ /** Whether this file is the index file for its directory group */
44
+ isGroupIndex: boolean;
45
+ /** If this is a group index, any specific frontmatter metadata dictating the group's title and position */
46
+ groupMeta?: { title: string; position?: number };
47
+ /** Extracted group position from the directory name if it has a numeric prefix */
48
+ inferredGroupPosition?: number;
49
+ }