boltdocs 1.10.2 → 1.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/package.json +29 -7
- package/src/client/app/config-context.tsx +18 -0
- package/src/client/app/docs-layout.tsx +14 -0
- package/src/client/app/index.tsx +132 -260
- package/src/client/app/mdx-component.tsx +52 -0
- package/src/client/app/mdx-components-context.tsx +23 -0
- package/src/client/app/mdx-page.tsx +20 -0
- package/src/client/app/preload.tsx +38 -30
- package/src/client/app/router.tsx +30 -0
- package/src/client/app/scroll-handler.tsx +40 -0
- package/src/client/app/theme-context.tsx +75 -0
- package/src/client/components/default-layout.tsx +80 -0
- package/src/client/components/docs-layout.tsx +105 -0
- package/src/client/components/icons-dev.tsx +74 -0
- package/src/client/components/mdx/admonition.tsx +107 -0
- package/src/client/components/mdx/badge.tsx +41 -0
- package/src/client/components/mdx/button.tsx +35 -0
- package/src/client/components/mdx/card.tsx +124 -0
- package/src/client/components/mdx/code-block.tsx +119 -0
- package/src/client/components/mdx/component-preview.tsx +47 -0
- package/src/client/components/mdx/component-props.tsx +83 -0
- package/src/client/components/mdx/field.tsx +66 -0
- package/src/client/components/mdx/file-tree.tsx +287 -0
- package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
- package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
- package/src/client/components/mdx/hooks/useTable.ts +74 -0
- package/src/client/components/mdx/hooks/useTabs.ts +68 -0
- package/src/client/components/mdx/image.tsx +23 -0
- package/src/client/components/mdx/index.ts +53 -0
- package/src/client/components/mdx/link.tsx +38 -0
- package/src/client/components/mdx/list.tsx +192 -0
- package/src/client/components/mdx/table.tsx +156 -0
- package/src/client/components/mdx/tabs.tsx +135 -0
- package/src/client/components/mdx/video.tsx +68 -0
- package/src/client/components/primitives/breadcrumbs.tsx +79 -0
- package/src/client/components/primitives/button-group.tsx +54 -0
- package/src/client/components/primitives/button.tsx +145 -0
- package/src/client/components/primitives/helpers/observer.ts +120 -0
- package/src/client/components/primitives/index.ts +17 -0
- package/src/client/components/primitives/link.tsx +122 -0
- package/src/client/components/primitives/menu.tsx +159 -0
- package/src/client/components/primitives/navbar.tsx +359 -0
- package/src/client/components/primitives/navigation-menu.tsx +116 -0
- package/src/client/components/primitives/on-this-page.tsx +461 -0
- package/src/client/components/primitives/page-nav.tsx +87 -0
- package/src/client/components/primitives/popover.tsx +47 -0
- package/src/client/components/primitives/search-dialog.tsx +183 -0
- package/src/client/components/primitives/sidebar.tsx +154 -0
- package/src/client/components/primitives/tabs.tsx +90 -0
- package/src/client/components/primitives/tooltip.tsx +83 -0
- package/src/client/components/primitives/types.ts +11 -0
- package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
- package/src/client/components/ui-base/copy-markdown.tsx +112 -0
- package/src/client/components/ui-base/error-boundary.tsx +52 -0
- package/src/client/components/ui-base/github-stars.tsx +27 -0
- package/src/client/components/ui-base/head.tsx +69 -0
- package/src/client/components/ui-base/loading.tsx +87 -0
- package/src/client/components/ui-base/navbar.tsx +138 -0
- package/src/client/components/ui-base/not-found.tsx +24 -0
- package/src/client/components/ui-base/on-this-page.tsx +152 -0
- package/src/client/components/ui-base/page-nav.tsx +39 -0
- package/src/client/components/ui-base/powered-by.tsx +19 -0
- package/src/client/components/ui-base/progress-bar.tsx +67 -0
- package/src/client/components/ui-base/search-dialog.tsx +82 -0
- package/src/client/components/ui-base/sidebar.tsx +104 -0
- package/src/client/components/ui-base/tabs.tsx +65 -0
- package/src/client/components/ui-base/theme-toggle.tsx +32 -0
- package/src/client/hooks/index.ts +12 -0
- package/src/client/hooks/use-breadcrumbs.ts +22 -0
- package/src/client/hooks/use-i18n.ts +84 -0
- package/src/client/hooks/use-localized-to.ts +95 -0
- package/src/client/hooks/use-location.ts +5 -0
- package/src/client/hooks/use-navbar.ts +60 -0
- package/src/client/hooks/use-onthispage.ts +23 -0
- package/src/client/hooks/use-page-nav.ts +22 -0
- package/src/client/hooks/use-routes.ts +72 -0
- package/src/client/hooks/use-search.ts +71 -0
- package/src/client/hooks/use-sidebar.ts +49 -0
- package/src/client/hooks/use-tabs.ts +43 -0
- package/src/client/hooks/use-version.ts +78 -0
- package/src/client/index.ts +55 -17
- package/src/client/integrations/codesandbox.ts +179 -0
- package/src/client/ssr.tsx +27 -16
- package/src/client/theme/neutral.css +360 -0
- package/src/client/types.ts +131 -27
- package/src/client/utils/cn.ts +6 -0
- package/src/client/utils/copy-clipboard.ts +22 -0
- package/src/client/utils/get-base-file-path.ts +21 -0
- package/src/client/utils/github.ts +121 -0
- package/src/client/utils/use-on-change.ts +15 -0
- package/src/client/virtual.d.ts +24 -0
- package/src/node/cache.ts +156 -156
- package/src/node/config.ts +159 -103
- package/src/node/index.ts +13 -13
- package/src/node/mdx.ts +213 -61
- package/src/node/plugin/entry.ts +29 -18
- package/src/node/plugin/html.ts +11 -11
- package/src/node/plugin/index.ts +161 -83
- package/src/node/plugin/types.ts +2 -4
- package/src/node/routes/cache.ts +6 -6
- package/src/node/routes/index.ts +206 -113
- package/src/node/routes/parser.ts +106 -81
- package/src/node/routes/sorter.ts +15 -15
- package/src/node/routes/types.ts +24 -24
- package/src/node/ssg/index.ts +46 -46
- package/src/node/ssg/meta.ts +4 -4
- package/src/node/ssg/options.ts +5 -5
- package/src/node/ssg/sitemap.ts +14 -14
- package/src/node/utils.ts +31 -31
- package/tsconfig.json +25 -20
- package/tsup.config.ts +23 -14
- package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
- package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
- package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
- package/dist/Video-KNTY5BNO.mjs +0 -6
- package/dist/cache-KNL5B4EE.mjs +0 -12
- package/dist/chunk-7SFUJWTB.mjs +0 -211
- package/dist/chunk-FFBNU6IJ.mjs +0 -386
- package/dist/chunk-FMTOYQLO.mjs +0 -37
- package/dist/chunk-TKLQWU7H.mjs +0 -1920
- package/dist/chunk-Z7JHYNAS.mjs +0 -57
- package/dist/client/index.css +0 -2847
- package/dist/client/index.d.mts +0 -372
- package/dist/client/index.d.ts +0 -372
- package/dist/client/index.js +0 -3630
- package/dist/client/index.mjs +0 -697
- package/dist/client/ssr.css +0 -2847
- package/dist/client/ssr.d.mts +0 -27
- package/dist/client/ssr.d.ts +0 -27
- package/dist/client/ssr.js +0 -2928
- package/dist/client/ssr.mjs +0 -33
- package/dist/config-BsFQ-ErD.d.mts +0 -159
- package/dist/config-BsFQ-ErD.d.ts +0 -159
- package/dist/node/index.d.mts +0 -91
- package/dist/node/index.d.ts +0 -91
- package/dist/node/index.js +0 -1187
- package/dist/node/index.mjs +0 -762
- package/dist/types-Dj-bfnC3.d.mts +0 -74
- package/dist/types-Dj-bfnC3.d.ts +0 -74
- package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
- package/src/client/theme/components/CodeBlock/index.ts +0 -1
- package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
- package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
- package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
- package/src/client/theme/components/Playground/Playground.tsx +0 -180
- package/src/client/theme/components/Playground/index.ts +0 -1
- package/src/client/theme/components/Playground/playground.css +0 -238
- package/src/client/theme/components/Video/Video.tsx +0 -84
- package/src/client/theme/components/Video/index.ts +0 -1
- package/src/client/theme/components/Video/video.css +0 -41
- package/src/client/theme/components/mdx/Admonition.tsx +0 -80
- package/src/client/theme/components/mdx/Badge.tsx +0 -31
- package/src/client/theme/components/mdx/Button.tsx +0 -50
- package/src/client/theme/components/mdx/Card.tsx +0 -80
- package/src/client/theme/components/mdx/Field.tsx +0 -60
- package/src/client/theme/components/mdx/FileTree.tsx +0 -229
- package/src/client/theme/components/mdx/List.tsx +0 -57
- package/src/client/theme/components/mdx/Table.tsx +0 -151
- package/src/client/theme/components/mdx/Tabs.tsx +0 -123
- package/src/client/theme/components/mdx/index.ts +0 -27
- package/src/client/theme/components/mdx/mdx-components.css +0 -764
- package/src/client/theme/icons/bun.tsx +0 -62
- package/src/client/theme/icons/deno.tsx +0 -20
- package/src/client/theme/icons/discord.tsx +0 -12
- package/src/client/theme/icons/github.tsx +0 -15
- package/src/client/theme/icons/npm.tsx +0 -13
- package/src/client/theme/icons/pnpm.tsx +0 -72
- package/src/client/theme/icons/twitter.tsx +0 -12
- package/src/client/theme/styles/markdown.css +0 -394
- package/src/client/theme/styles/variables.css +0 -175
- package/src/client/theme/styles.css +0 -39
- package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
- package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
- package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
- package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
- package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
- package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
- package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
- package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
- package/src/client/theme/ui/Footer/footer.css +0 -32
- package/src/client/theme/ui/Head/Head.tsx +0 -69
- package/src/client/theme/ui/Head/index.ts +0 -1
- package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
- package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
- package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
- package/src/client/theme/ui/Layout/Layout.tsx +0 -203
- package/src/client/theme/ui/Layout/base.css +0 -106
- package/src/client/theme/ui/Layout/index.ts +0 -2
- package/src/client/theme/ui/Layout/pagination.css +0 -72
- package/src/client/theme/ui/Layout/responsive.css +0 -47
- package/src/client/theme/ui/Link/Link.tsx +0 -392
- package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
- package/src/client/theme/ui/Link/index.ts +0 -2
- package/src/client/theme/ui/Link/link-preview.css +0 -48
- package/src/client/theme/ui/Loading/Loading.tsx +0 -10
- package/src/client/theme/ui/Loading/index.ts +0 -1
- package/src/client/theme/ui/Loading/loading.css +0 -30
- package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
- package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
- package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
- package/src/client/theme/ui/Navbar/index.ts +0 -2
- package/src/client/theme/ui/Navbar/navbar.css +0 -347
- package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
- package/src/client/theme/ui/NotFound/index.ts +0 -1
- package/src/client/theme/ui/NotFound/not-found.css +0 -64
- package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
- package/src/client/theme/ui/OnThisPage/index.ts +0 -1
- package/src/client/theme/ui/OnThisPage/toc.css +0 -152
- package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
- package/src/client/theme/ui/PoweredBy/index.ts +0 -1
- package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
- package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
- package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
- package/src/client/theme/ui/ProgressBar/index.ts +0 -1
- package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
- package/src/client/theme/ui/SearchDialog/index.ts +0 -1
- package/src/client/theme/ui/SearchDialog/search.css +0 -152
- package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
- package/src/client/theme/ui/Sidebar/index.ts +0 -1
- package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
- package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
- package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
- package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
- package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
- package/src/client/utils.ts +0 -49
package/dist/client/ssr.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AppShell
|
|
3
|
-
} from "../chunk-TKLQWU7H.mjs";
|
|
4
|
-
import "../chunk-FMTOYQLO.mjs";
|
|
5
|
-
|
|
6
|
-
// src/client/ssr.tsx
|
|
7
|
-
import React from "react";
|
|
8
|
-
import ReactDOMServer from "react-dom/server";
|
|
9
|
-
import { StaticRouter } from "react-router-dom/server";
|
|
10
|
-
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
async function render(options) {
|
|
12
|
-
const { path, routes, config, modules, homePage, docsDirName } = options;
|
|
13
|
-
const resolvedModules = {};
|
|
14
|
-
for (const [key, mod] of Object.entries(modules)) {
|
|
15
|
-
resolvedModules[key] = () => Promise.resolve(mod);
|
|
16
|
-
}
|
|
17
|
-
const html = ReactDOMServer.renderToString(
|
|
18
|
-
/* @__PURE__ */ jsx(React.StrictMode, { children: /* @__PURE__ */ jsx(StaticRouter, { location: path, children: /* @__PURE__ */ jsx(
|
|
19
|
-
AppShell,
|
|
20
|
-
{
|
|
21
|
-
initialRoutes: routes,
|
|
22
|
-
initialConfig: config,
|
|
23
|
-
docsDirName,
|
|
24
|
-
modules: resolvedModules,
|
|
25
|
-
homePage
|
|
26
|
-
}
|
|
27
|
-
) }) })
|
|
28
|
-
);
|
|
29
|
-
return html;
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
render
|
|
33
|
-
};
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Represents a single social link in the configuration.
|
|
5
|
-
*/
|
|
6
|
-
interface BoltdocsSocialLink {
|
|
7
|
-
/** Identifier for the icon (e.g., 'github', 'twitter') */
|
|
8
|
-
icon: "discord" | "x" | string;
|
|
9
|
-
/** The URL the social link points to */
|
|
10
|
-
link: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Configuration for the site footer.
|
|
14
|
-
*/
|
|
15
|
-
interface BoltdocsFooterConfig {
|
|
16
|
-
/** Text to display in the footer (HTML is supported) */
|
|
17
|
-
text?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Theme-specific configuration options governing the appearance and navigation of the site.
|
|
21
|
-
*/
|
|
22
|
-
interface BoltdocsThemeConfig {
|
|
23
|
-
/** The global title of the documentation site */
|
|
24
|
-
title?: string;
|
|
25
|
-
/** The global description of the site (used for SEO) */
|
|
26
|
-
description?: string;
|
|
27
|
-
/** URL path to the site logo */
|
|
28
|
-
logo?: string;
|
|
29
|
-
/** Items to display in the top navigation bar */
|
|
30
|
-
navbar?: Array<{
|
|
31
|
-
/** Text to display (alias for text) */
|
|
32
|
-
label?: string;
|
|
33
|
-
/** Text to display */
|
|
34
|
-
text?: string;
|
|
35
|
-
/** URL path or external link (alias for link) */
|
|
36
|
-
to?: string;
|
|
37
|
-
/** URL path or external link (alias for link) */
|
|
38
|
-
href?: string;
|
|
39
|
-
/** URL path or external link */
|
|
40
|
-
link?: string;
|
|
41
|
-
/** Alignment of the item in the navbar */
|
|
42
|
-
position?: "left" | "right";
|
|
43
|
-
}>;
|
|
44
|
-
/** Items to display in the sidebar, organized optionally by group URLs */
|
|
45
|
-
sidebar?: Record<string, Array<{
|
|
46
|
-
text: string;
|
|
47
|
-
link: string;
|
|
48
|
-
}>>;
|
|
49
|
-
/** Social links to display in the navigation bar */
|
|
50
|
-
socialLinks?: BoltdocsSocialLink[];
|
|
51
|
-
/** Site footer configuration */
|
|
52
|
-
footer?: BoltdocsFooterConfig;
|
|
53
|
-
/** Whether to show breadcrumbs navigation (default: true) */
|
|
54
|
-
breadcrumbs?: boolean;
|
|
55
|
-
/** Path to a custom CSS file that overrides theme variables */
|
|
56
|
-
customCss?: string;
|
|
57
|
-
/** URL template for 'Edit this page'. Use :path as a placeholder. */
|
|
58
|
-
editLink?: string;
|
|
59
|
-
/** URL for the 'Community help' link. */
|
|
60
|
-
communityHelp?: string;
|
|
61
|
-
/** The current version of the project (e.g., 'v2.8.9'). Displayed in the Navbar. */
|
|
62
|
-
version?: string;
|
|
63
|
-
/** The GitHub repository in the format 'owner/repo' to fetch and display star count. */
|
|
64
|
-
githubRepo?: string;
|
|
65
|
-
/** Whether to show the 'Powered by LiteDocs' badge in the sidebar (default: true) */
|
|
66
|
-
poweredBy?: boolean;
|
|
67
|
-
/** Whether to show a preview tooltip on internal links hover (default: true) */
|
|
68
|
-
linkPreview?: boolean;
|
|
69
|
-
/** Granular layout customization props */
|
|
70
|
-
layoutProps?: {
|
|
71
|
-
navbar?: any;
|
|
72
|
-
sidebar?: any;
|
|
73
|
-
toc?: any;
|
|
74
|
-
background?: any;
|
|
75
|
-
head?: any;
|
|
76
|
-
breadcrumbs?: any;
|
|
77
|
-
className?: string;
|
|
78
|
-
style?: any;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Top-level tabs for organizing documentation groups.
|
|
82
|
-
* Tab discovery uses the (tab-id) directory syntax.
|
|
83
|
-
*/
|
|
84
|
-
tabs?: Array<{
|
|
85
|
-
id: string;
|
|
86
|
-
text: string;
|
|
87
|
-
icon?: string;
|
|
88
|
-
}>;
|
|
89
|
-
/**
|
|
90
|
-
* The syntax highlighting theme for code blocks.
|
|
91
|
-
* Supports any Shiki theme name (e.g., 'github-dark', 'one-dark-pro', 'aurora-x').
|
|
92
|
-
* Can also be an object for multiple themes (e.g., { light: 'github-light', dark: 'github-dark' }).
|
|
93
|
-
* Default: 'one-dark-pro'
|
|
94
|
-
*/
|
|
95
|
-
codeTheme?: string | Record<string, string>;
|
|
96
|
-
/**
|
|
97
|
-
* Configuration for the 'Copy Markdown' button.
|
|
98
|
-
* Can be a boolean or an object with text and icon.
|
|
99
|
-
* Default: true
|
|
100
|
-
*/
|
|
101
|
-
copyMarkdown?: boolean | {
|
|
102
|
-
text?: string;
|
|
103
|
-
icon?: string;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Configuration for internationalization (i18n).
|
|
108
|
-
*/
|
|
109
|
-
interface BoltdocsI18nConfig {
|
|
110
|
-
/** The default locale (e.g., 'en') */
|
|
111
|
-
defaultLocale: string;
|
|
112
|
-
/** Available locales and their display names (e.g., { en: 'English', es: 'Español' }) */
|
|
113
|
-
locales: Record<string, string>;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Configuration for documentation versioning.
|
|
117
|
-
*/
|
|
118
|
-
interface BoltdocsVersionsConfig {
|
|
119
|
-
/** The default version (e.g., 'v2') */
|
|
120
|
-
defaultVersion: string;
|
|
121
|
-
/** Available versions and their display names (e.g., { v1: 'Version 1.x', v2: 'Version 2.x' }) */
|
|
122
|
-
versions: Record<string, string>;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Defines a Boltdocs plugin that can extend the build process and client-side functionality.
|
|
126
|
-
*/
|
|
127
|
-
interface BoltdocsPlugin {
|
|
128
|
-
/** A unique name for the plugin */
|
|
129
|
-
name: string;
|
|
130
|
-
/** Whether to run this plugin before or after default ones (optional) */
|
|
131
|
-
enforce?: "pre" | "post";
|
|
132
|
-
/** Optional remark plugins to add to the MDX pipeline */
|
|
133
|
-
remarkPlugins?: any[];
|
|
134
|
-
/** Optional rehype plugins to add to the MDX pipeline */
|
|
135
|
-
rehypePlugins?: any[];
|
|
136
|
-
/** Optional Vite plugins to inject into the build process */
|
|
137
|
-
vitePlugins?: Plugin[];
|
|
138
|
-
/** Optional custom React components to register in MDX. Map of Name -> Module Path. */
|
|
139
|
-
components?: Record<string, string>;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* The root configuration object for Boltdocs.
|
|
143
|
-
*/
|
|
144
|
-
interface BoltdocsConfig {
|
|
145
|
-
/** The base URL of the site, used for generating the sitemap */
|
|
146
|
-
siteUrl?: string;
|
|
147
|
-
/** Configuration pertaining to the UI and appearance */
|
|
148
|
-
themeConfig?: BoltdocsThemeConfig;
|
|
149
|
-
/** The root directory containing markdown documentation files (default: 'docs') */
|
|
150
|
-
docsDir?: string;
|
|
151
|
-
/** Configuration for internationalization */
|
|
152
|
-
i18n?: BoltdocsI18nConfig;
|
|
153
|
-
/** Configuration for documentation versioning */
|
|
154
|
-
versions?: BoltdocsVersionsConfig;
|
|
155
|
-
/** Custom plugins for extending functionality */
|
|
156
|
-
plugins?: BoltdocsPlugin[];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export type { BoltdocsConfig as B, BoltdocsThemeConfig as a };
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Represents a single social link in the configuration.
|
|
5
|
-
*/
|
|
6
|
-
interface BoltdocsSocialLink {
|
|
7
|
-
/** Identifier for the icon (e.g., 'github', 'twitter') */
|
|
8
|
-
icon: "discord" | "x" | string;
|
|
9
|
-
/** The URL the social link points to */
|
|
10
|
-
link: string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Configuration for the site footer.
|
|
14
|
-
*/
|
|
15
|
-
interface BoltdocsFooterConfig {
|
|
16
|
-
/** Text to display in the footer (HTML is supported) */
|
|
17
|
-
text?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Theme-specific configuration options governing the appearance and navigation of the site.
|
|
21
|
-
*/
|
|
22
|
-
interface BoltdocsThemeConfig {
|
|
23
|
-
/** The global title of the documentation site */
|
|
24
|
-
title?: string;
|
|
25
|
-
/** The global description of the site (used for SEO) */
|
|
26
|
-
description?: string;
|
|
27
|
-
/** URL path to the site logo */
|
|
28
|
-
logo?: string;
|
|
29
|
-
/** Items to display in the top navigation bar */
|
|
30
|
-
navbar?: Array<{
|
|
31
|
-
/** Text to display (alias for text) */
|
|
32
|
-
label?: string;
|
|
33
|
-
/** Text to display */
|
|
34
|
-
text?: string;
|
|
35
|
-
/** URL path or external link (alias for link) */
|
|
36
|
-
to?: string;
|
|
37
|
-
/** URL path or external link (alias for link) */
|
|
38
|
-
href?: string;
|
|
39
|
-
/** URL path or external link */
|
|
40
|
-
link?: string;
|
|
41
|
-
/** Alignment of the item in the navbar */
|
|
42
|
-
position?: "left" | "right";
|
|
43
|
-
}>;
|
|
44
|
-
/** Items to display in the sidebar, organized optionally by group URLs */
|
|
45
|
-
sidebar?: Record<string, Array<{
|
|
46
|
-
text: string;
|
|
47
|
-
link: string;
|
|
48
|
-
}>>;
|
|
49
|
-
/** Social links to display in the navigation bar */
|
|
50
|
-
socialLinks?: BoltdocsSocialLink[];
|
|
51
|
-
/** Site footer configuration */
|
|
52
|
-
footer?: BoltdocsFooterConfig;
|
|
53
|
-
/** Whether to show breadcrumbs navigation (default: true) */
|
|
54
|
-
breadcrumbs?: boolean;
|
|
55
|
-
/** Path to a custom CSS file that overrides theme variables */
|
|
56
|
-
customCss?: string;
|
|
57
|
-
/** URL template for 'Edit this page'. Use :path as a placeholder. */
|
|
58
|
-
editLink?: string;
|
|
59
|
-
/** URL for the 'Community help' link. */
|
|
60
|
-
communityHelp?: string;
|
|
61
|
-
/** The current version of the project (e.g., 'v2.8.9'). Displayed in the Navbar. */
|
|
62
|
-
version?: string;
|
|
63
|
-
/** The GitHub repository in the format 'owner/repo' to fetch and display star count. */
|
|
64
|
-
githubRepo?: string;
|
|
65
|
-
/** Whether to show the 'Powered by LiteDocs' badge in the sidebar (default: true) */
|
|
66
|
-
poweredBy?: boolean;
|
|
67
|
-
/** Whether to show a preview tooltip on internal links hover (default: true) */
|
|
68
|
-
linkPreview?: boolean;
|
|
69
|
-
/** Granular layout customization props */
|
|
70
|
-
layoutProps?: {
|
|
71
|
-
navbar?: any;
|
|
72
|
-
sidebar?: any;
|
|
73
|
-
toc?: any;
|
|
74
|
-
background?: any;
|
|
75
|
-
head?: any;
|
|
76
|
-
breadcrumbs?: any;
|
|
77
|
-
className?: string;
|
|
78
|
-
style?: any;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Top-level tabs for organizing documentation groups.
|
|
82
|
-
* Tab discovery uses the (tab-id) directory syntax.
|
|
83
|
-
*/
|
|
84
|
-
tabs?: Array<{
|
|
85
|
-
id: string;
|
|
86
|
-
text: string;
|
|
87
|
-
icon?: string;
|
|
88
|
-
}>;
|
|
89
|
-
/**
|
|
90
|
-
* The syntax highlighting theme for code blocks.
|
|
91
|
-
* Supports any Shiki theme name (e.g., 'github-dark', 'one-dark-pro', 'aurora-x').
|
|
92
|
-
* Can also be an object for multiple themes (e.g., { light: 'github-light', dark: 'github-dark' }).
|
|
93
|
-
* Default: 'one-dark-pro'
|
|
94
|
-
*/
|
|
95
|
-
codeTheme?: string | Record<string, string>;
|
|
96
|
-
/**
|
|
97
|
-
* Configuration for the 'Copy Markdown' button.
|
|
98
|
-
* Can be a boolean or an object with text and icon.
|
|
99
|
-
* Default: true
|
|
100
|
-
*/
|
|
101
|
-
copyMarkdown?: boolean | {
|
|
102
|
-
text?: string;
|
|
103
|
-
icon?: string;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Configuration for internationalization (i18n).
|
|
108
|
-
*/
|
|
109
|
-
interface BoltdocsI18nConfig {
|
|
110
|
-
/** The default locale (e.g., 'en') */
|
|
111
|
-
defaultLocale: string;
|
|
112
|
-
/** Available locales and their display names (e.g., { en: 'English', es: 'Español' }) */
|
|
113
|
-
locales: Record<string, string>;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Configuration for documentation versioning.
|
|
117
|
-
*/
|
|
118
|
-
interface BoltdocsVersionsConfig {
|
|
119
|
-
/** The default version (e.g., 'v2') */
|
|
120
|
-
defaultVersion: string;
|
|
121
|
-
/** Available versions and their display names (e.g., { v1: 'Version 1.x', v2: 'Version 2.x' }) */
|
|
122
|
-
versions: Record<string, string>;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Defines a Boltdocs plugin that can extend the build process and client-side functionality.
|
|
126
|
-
*/
|
|
127
|
-
interface BoltdocsPlugin {
|
|
128
|
-
/** A unique name for the plugin */
|
|
129
|
-
name: string;
|
|
130
|
-
/** Whether to run this plugin before or after default ones (optional) */
|
|
131
|
-
enforce?: "pre" | "post";
|
|
132
|
-
/** Optional remark plugins to add to the MDX pipeline */
|
|
133
|
-
remarkPlugins?: any[];
|
|
134
|
-
/** Optional rehype plugins to add to the MDX pipeline */
|
|
135
|
-
rehypePlugins?: any[];
|
|
136
|
-
/** Optional Vite plugins to inject into the build process */
|
|
137
|
-
vitePlugins?: Plugin[];
|
|
138
|
-
/** Optional custom React components to register in MDX. Map of Name -> Module Path. */
|
|
139
|
-
components?: Record<string, string>;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* The root configuration object for Boltdocs.
|
|
143
|
-
*/
|
|
144
|
-
interface BoltdocsConfig {
|
|
145
|
-
/** The base URL of the site, used for generating the sitemap */
|
|
146
|
-
siteUrl?: string;
|
|
147
|
-
/** Configuration pertaining to the UI and appearance */
|
|
148
|
-
themeConfig?: BoltdocsThemeConfig;
|
|
149
|
-
/** The root directory containing markdown documentation files (default: 'docs') */
|
|
150
|
-
docsDir?: string;
|
|
151
|
-
/** Configuration for internationalization */
|
|
152
|
-
i18n?: BoltdocsI18nConfig;
|
|
153
|
-
/** Configuration for documentation versioning */
|
|
154
|
-
versions?: BoltdocsVersionsConfig;
|
|
155
|
-
/** Custom plugins for extending functionality */
|
|
156
|
-
plugins?: BoltdocsPlugin[];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export type { BoltdocsConfig as B, BoltdocsThemeConfig as a };
|
package/dist/node/index.d.mts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import { B as BoltdocsConfig } from '../config-BsFQ-ErD.mjs';
|
|
3
|
-
export { a as BoltdocsThemeConfig } from '../config-BsFQ-ErD.mjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Configuration options specifically for the Boltdocs Vite plugin.
|
|
7
|
-
*/
|
|
8
|
-
interface BoltdocsPluginOptions {
|
|
9
|
-
/** The root directory containing markdown files (default: 'docs') */
|
|
10
|
-
docsDir?: string;
|
|
11
|
-
/** Path to a custom home page component (relative to project root) to render at '/' */
|
|
12
|
-
homePage?: string;
|
|
13
|
-
/** Path to a custom CSS file to override theme variables. Can also be set in boltdocs.config.js */
|
|
14
|
-
customCss?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Options for the Static Site Generation process.
|
|
19
|
-
*/
|
|
20
|
-
interface SSGOptions {
|
|
21
|
-
/** The root directory containing markdown documentation files */
|
|
22
|
-
docsDir: string;
|
|
23
|
-
/** The name of the documentation directory (e.g. 'docs') */
|
|
24
|
-
docsDirName: string;
|
|
25
|
-
/** The output directory where Vite placed the compiled `index.html` and assets */
|
|
26
|
-
outDir: string;
|
|
27
|
-
/** Pre-resolved config (avoids re-resolving during the SSG phase) */
|
|
28
|
-
config?: BoltdocsConfig;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Generates static HTML files and a \`sitemap.xml\` for all documentation routes.
|
|
33
|
-
* Called automatically in the \`closeBundle\` hook of the Vite plugin during a production build.
|
|
34
|
-
*
|
|
35
|
-
* @param options - Configuration for paths and site metadata
|
|
36
|
-
*/
|
|
37
|
-
declare function generateStaticPages(options: SSGOptions): Promise<void>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Metadata representing a single documentation route.
|
|
41
|
-
* This information is used to build the client-side router and the sidebar navigation.
|
|
42
|
-
*/
|
|
43
|
-
interface RouteMeta {
|
|
44
|
-
/** The final URL path for the route (e.g., '/docs/guide/start') */
|
|
45
|
-
path: string;
|
|
46
|
-
/** The absolute filesystem path to the source markdown/mdx file */
|
|
47
|
-
componentPath: string;
|
|
48
|
-
/** The title of the page, usually extracted from frontmatter or the filename */
|
|
49
|
-
title: string;
|
|
50
|
-
/** The relative path from the docs directory, used for edit links */
|
|
51
|
-
filePath: string;
|
|
52
|
-
/** Optional description of the page (for SEO/meta tags) */
|
|
53
|
-
description?: string;
|
|
54
|
-
/** Optional explicit position for ordering in the sidebar */
|
|
55
|
-
sidebarPosition?: number;
|
|
56
|
-
/** The group (directory) this route belongs to */
|
|
57
|
-
group?: string;
|
|
58
|
-
/** The display title for the route's group */
|
|
59
|
-
groupTitle?: string;
|
|
60
|
-
/** Optional explicit position for ordering the group itself */
|
|
61
|
-
groupPosition?: number;
|
|
62
|
-
/** Optional icon for the route's group */
|
|
63
|
-
groupIcon?: string;
|
|
64
|
-
/** Extracted markdown headings for search indexing */
|
|
65
|
-
headings?: {
|
|
66
|
-
level: number;
|
|
67
|
-
text: string;
|
|
68
|
-
id: string;
|
|
69
|
-
}[];
|
|
70
|
-
/** The locale this route belongs to, if i18n is configured */
|
|
71
|
-
locale?: string;
|
|
72
|
-
/** The version this route belongs to, if versioning is configured */
|
|
73
|
-
version?: string;
|
|
74
|
-
/** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
|
|
75
|
-
badge?: string | {
|
|
76
|
-
text: string;
|
|
77
|
-
expires?: string;
|
|
78
|
-
};
|
|
79
|
-
/** Optional icon to display (Lucide icon name or raw SVG) */
|
|
80
|
-
icon?: string;
|
|
81
|
-
/** The tab this route belongs to, if tabs are configured */
|
|
82
|
-
tab?: string;
|
|
83
|
-
/** The extracted plain-text content of the page for search indexing */
|
|
84
|
-
_content?: string;
|
|
85
|
-
/** The raw markdown content of the page */
|
|
86
|
-
_rawContent?: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
90
|
-
|
|
91
|
-
export { BoltdocsConfig, type BoltdocsPluginOptions, type RouteMeta, type SSGOptions, boltdocs as default, generateStaticPages };
|
package/dist/node/index.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'vite';
|
|
2
|
-
import { B as BoltdocsConfig } from '../config-BsFQ-ErD.js';
|
|
3
|
-
export { a as BoltdocsThemeConfig } from '../config-BsFQ-ErD.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Configuration options specifically for the Boltdocs Vite plugin.
|
|
7
|
-
*/
|
|
8
|
-
interface BoltdocsPluginOptions {
|
|
9
|
-
/** The root directory containing markdown files (default: 'docs') */
|
|
10
|
-
docsDir?: string;
|
|
11
|
-
/** Path to a custom home page component (relative to project root) to render at '/' */
|
|
12
|
-
homePage?: string;
|
|
13
|
-
/** Path to a custom CSS file to override theme variables. Can also be set in boltdocs.config.js */
|
|
14
|
-
customCss?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Options for the Static Site Generation process.
|
|
19
|
-
*/
|
|
20
|
-
interface SSGOptions {
|
|
21
|
-
/** The root directory containing markdown documentation files */
|
|
22
|
-
docsDir: string;
|
|
23
|
-
/** The name of the documentation directory (e.g. 'docs') */
|
|
24
|
-
docsDirName: string;
|
|
25
|
-
/** The output directory where Vite placed the compiled `index.html` and assets */
|
|
26
|
-
outDir: string;
|
|
27
|
-
/** Pre-resolved config (avoids re-resolving during the SSG phase) */
|
|
28
|
-
config?: BoltdocsConfig;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Generates static HTML files and a \`sitemap.xml\` for all documentation routes.
|
|
33
|
-
* Called automatically in the \`closeBundle\` hook of the Vite plugin during a production build.
|
|
34
|
-
*
|
|
35
|
-
* @param options - Configuration for paths and site metadata
|
|
36
|
-
*/
|
|
37
|
-
declare function generateStaticPages(options: SSGOptions): Promise<void>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Metadata representing a single documentation route.
|
|
41
|
-
* This information is used to build the client-side router and the sidebar navigation.
|
|
42
|
-
*/
|
|
43
|
-
interface RouteMeta {
|
|
44
|
-
/** The final URL path for the route (e.g., '/docs/guide/start') */
|
|
45
|
-
path: string;
|
|
46
|
-
/** The absolute filesystem path to the source markdown/mdx file */
|
|
47
|
-
componentPath: string;
|
|
48
|
-
/** The title of the page, usually extracted from frontmatter or the filename */
|
|
49
|
-
title: string;
|
|
50
|
-
/** The relative path from the docs directory, used for edit links */
|
|
51
|
-
filePath: string;
|
|
52
|
-
/** Optional description of the page (for SEO/meta tags) */
|
|
53
|
-
description?: string;
|
|
54
|
-
/** Optional explicit position for ordering in the sidebar */
|
|
55
|
-
sidebarPosition?: number;
|
|
56
|
-
/** The group (directory) this route belongs to */
|
|
57
|
-
group?: string;
|
|
58
|
-
/** The display title for the route's group */
|
|
59
|
-
groupTitle?: string;
|
|
60
|
-
/** Optional explicit position for ordering the group itself */
|
|
61
|
-
groupPosition?: number;
|
|
62
|
-
/** Optional icon for the route's group */
|
|
63
|
-
groupIcon?: string;
|
|
64
|
-
/** Extracted markdown headings for search indexing */
|
|
65
|
-
headings?: {
|
|
66
|
-
level: number;
|
|
67
|
-
text: string;
|
|
68
|
-
id: string;
|
|
69
|
-
}[];
|
|
70
|
-
/** The locale this route belongs to, if i18n is configured */
|
|
71
|
-
locale?: string;
|
|
72
|
-
/** The version this route belongs to, if versioning is configured */
|
|
73
|
-
version?: string;
|
|
74
|
-
/** Optional badge to display next to the sidebar item (e.g., 'New', 'Experimental') */
|
|
75
|
-
badge?: string | {
|
|
76
|
-
text: string;
|
|
77
|
-
expires?: string;
|
|
78
|
-
};
|
|
79
|
-
/** Optional icon to display (Lucide icon name or raw SVG) */
|
|
80
|
-
icon?: string;
|
|
81
|
-
/** The tab this route belongs to, if tabs are configured */
|
|
82
|
-
tab?: string;
|
|
83
|
-
/** The extracted plain-text content of the page for search indexing */
|
|
84
|
-
_content?: string;
|
|
85
|
-
/** The raw markdown content of the page */
|
|
86
|
-
_rawContent?: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
|
|
90
|
-
|
|
91
|
-
export { BoltdocsConfig, type BoltdocsPluginOptions, type RouteMeta, type SSGOptions, boltdocs as default, generateStaticPages };
|