@vite-hub/docs 0.0.0-stage → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +453 -2
- package/dist/agent-copy-BJp_Yf5d.js +33 -0
- package/dist/assistant-shared-CdtXowot.js +97 -0
- package/dist/assistant-shared-Dll_F_yy.d.ts +27 -0
- package/dist/assistant-worker.d.ts +11 -0
- package/dist/assistant-worker.js +16 -0
- package/dist/assistant.d.ts +14 -0
- package/dist/assistant.js +19 -0
- package/dist/content-9CINWiRf.js +171 -0
- package/dist/draft-DUBx--r9.js +45 -0
- package/dist/error-diagnostics-BoOsP6Y4.js +53 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +27 -0
- package/dist/link-checker-redirects.d.ts +13 -0
- package/dist/link-checker-redirects.js +25 -0
- package/dist/manifest-D66AEF8F.js +420 -0
- package/dist/manifest-Dzp5-_AJ.d.ts +74 -0
- package/dist/markdown-Cn9-4oVG.js +378 -0
- package/dist/navigation.d.ts +284 -0
- package/dist/navigation.js +520 -0
- package/dist/nuxt-B5LrERKc.d.ts +240 -0
- package/dist/nuxt.d.ts +3 -0
- package/dist/nuxt.js +1485 -0
- package/dist/page-BbmSfZO8.js +81 -0
- package/dist/page-Dx2JD3y1.d.ts +74 -0
- package/dist/primitive-rail.d.ts +110 -0
- package/dist/primitive-rail.js +284 -0
- package/dist/raw-C03EUJKw.js +851 -0
- package/dist/redirects-BrbWFSzW.js +62 -0
- package/dist/runtime/app/app.vue +11 -0
- package/dist/runtime/app/assistant/DocsAssistant.vue +81 -0
- package/dist/runtime/app/assistant/DocsAssistantOff.vue +8 -0
- package/dist/runtime/app/assistant/DocsAssistantPanel.vue +322 -0
- package/dist/runtime/app/components/AppHeader.vue +368 -0
- package/dist/runtime/app/components/AppSearch.vue +68 -0
- package/dist/runtime/app/components/DocsAppShell.vue +62 -0
- package/dist/runtime/app/components/DocsArticle.vue +184 -0
- package/dist/runtime/app/components/DocsAsideFooter.vue +94 -0
- package/dist/runtime/app/components/DocsAsideLeftBody.vue +584 -0
- package/dist/runtime/app/components/DocsAsideLeftTop.vue +132 -0
- package/dist/runtime/app/components/DocsBrandMark.vue +52 -0
- package/dist/runtime/app/components/DocsCatalogFooter.vue +129 -0
- package/dist/runtime/app/components/DocsCodePanel.vue +388 -0
- package/dist/runtime/app/components/DocsCodePre.vue +120 -0
- package/dist/runtime/app/components/DocsHeaderActions.vue +4 -0
- package/dist/runtime/app/components/DocsLanding.vue +83 -0
- package/dist/runtime/app/components/DocsMarkdown.vue +64 -0
- package/dist/runtime/app/components/DocsPage.vue +149 -0
- package/dist/runtime/app/components/DocsPageCredits.vue +41 -0
- package/dist/runtime/app/components/DocsPageHeaderLinks.vue +120 -0
- package/dist/runtime/app/components/DocsRail.vue +239 -0
- package/dist/runtime/app/components/DocsSidebarStrip.vue +81 -0
- package/dist/runtime/app/components/DocsSidebars.vue +63 -0
- package/dist/runtime/app/components/OgImage/DocsPage.takumi.vue +33 -0
- package/dist/runtime/app/components/content/AgentOnly.vue +9 -0
- package/dist/runtime/app/components/content/CodeTree.vue +203 -0
- package/dist/runtime/app/components/content/ComarkHtml.vue +31 -0
- package/dist/runtime/app/components/content/Correct.vue +17 -0
- package/dist/runtime/app/components/content/Example.vue +260 -0
- package/dist/runtime/app/components/content/ExamplePreview.vue +6 -0
- package/dist/runtime/app/components/content/Examples.vue +71 -0
- package/dist/runtime/app/components/content/Incorrect.vue +17 -0
- package/dist/runtime/app/components/content/PageList.vue +206 -0
- package/dist/runtime/app/components/content/ProductFeatureItem.vue +43 -0
- package/dist/runtime/app/components/content/ProductFeatures.vue +17 -0
- package/dist/runtime/app/components/content/TutorialStep.vue +39 -0
- package/dist/runtime/app/composables/docs-assistant-problem.ts +59 -0
- package/dist/runtime/app/composables/docs-theme.ts +15 -0
- package/dist/runtime/app/composables/docs.ts +83 -0
- package/dist/runtime/app/composables/headerActions.ts +6 -0
- package/dist/runtime/app/composables/icons.ts +14 -0
- package/dist/runtime/app/composables/seo.ts +64 -0
- package/dist/runtime/app/composables/tutorial.ts +40 -0
- package/dist/runtime/app/composables/useDocsAssistant.ts +17 -0
- package/dist/runtime/app/error.vue +88 -0
- package/dist/runtime/app/layouts/default.vue +7 -0
- package/dist/runtime/app/layouts/docs.vue +104 -0
- package/dist/runtime/app/middleware/docs-layout.ts +23 -0
- package/dist/runtime/app/pages/docs-page.vue +3 -0
- package/dist/runtime/app/plugins/comark-css.ts +14 -0
- package/dist/runtime/app/plugins/icon-stroke.ts +12 -0
- package/dist/runtime/app/plugins/theme-color.ts +18 -0
- package/dist/runtime/app/utils/docs-theme.ts +43 -0
- package/dist/runtime/app/utils/file-tree.ts +40 -0
- package/dist/runtime/server/llms.d.ts +6 -0
- package/dist/runtime/server/llms.js +7 -0
- package/dist/runtime/server/markdown.d.ts +10 -0
- package/dist/runtime/server/markdown.js +11 -0
- package/dist/runtime/server/mcp.d.ts +6 -0
- package/dist/runtime/server/mcp.js +7 -0
- package/dist/runtime/server/page.d.ts +7 -0
- package/dist/runtime/server/page.js +27 -0
- package/dist/runtime/server/raw.d.ts +10 -0
- package/dist/runtime/server/raw.js +23 -0
- package/dist/runtime/server/search.d.ts +6 -0
- package/dist/runtime/server/search.js +32 -0
- package/dist/runtime/server/sitemap.d.ts +6 -0
- package/dist/runtime/server/sitemap.js +52 -0
- package/dist/runtime/server/trailing-slash.d.ts +10 -0
- package/dist/runtime/server/trailing-slash.js +28 -0
- package/dist/runtime/theme/design.css +464 -0
- package/dist/schema-DwpXW0VZ.js +98 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.js +5 -0
- package/dist/theme-BXyu4uFL.d.ts +32 -0
- package/dist/theme-DzC8LtMH.js +237 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +2 -0
- package/dist/types-BhG6vGfG.d.ts +212 -0
- package/package.json +141 -3
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { d as DocsSectionFile, r as DocsPage } from "./types-BhG6vGfG.js";
|
|
2
|
+
import { i as DocsSourceInput, s as DocsLinkCheckOptions } from "./manifest-Dzp5-_AJ.js";
|
|
3
|
+
import { DocsGroup, DocsIcons, DocsLink } from "./navigation.js";
|
|
4
|
+
import { ContentLlmsSection } from "@vite-hub/content";
|
|
5
|
+
import { PublicRuntimeConfig } from "nuxt/schema";
|
|
6
|
+
//#region src/comments-nuxt.d.ts
|
|
7
|
+
/** Comments on a docs site: the `comments` option of `vite-hub/nuxt`, which these pass to. */
|
|
8
|
+
interface DocsCommentsOptions {
|
|
9
|
+
/** The Database Definition that keeps the threads. Default: the default or only Database. */
|
|
10
|
+
database?: string;
|
|
11
|
+
/** SQL dialect of that Database. Default `sqlite`: SQLite, libSQL, and D1. */
|
|
12
|
+
dialect?: "postgresql" | "sqlite";
|
|
13
|
+
/** `false` leaves the overlay out of the pages. The Comments API, the operations, and the Console section stay. */
|
|
14
|
+
overlay?: false;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/nuxt.d.ts
|
|
18
|
+
interface DocsSiteOptions {
|
|
19
|
+
/** Name in titles, the rail, and llms.txt. */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** Canonical origin, such as `https://vitehub.dev`. Raw Markdown links, canonical links, and the sitemap use it. */
|
|
22
|
+
url?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The mark beside the name. A path is a one-color SVG that the theme fills with the text color, so it follows light and
|
|
26
|
+
* dark mode. `{ light, dark? }` shows images as they are, such as a colored logo, with `dark` in dark mode.
|
|
27
|
+
*/
|
|
28
|
+
logo?: string | {
|
|
29
|
+
light: string;
|
|
30
|
+
dark?: string;
|
|
31
|
+
};
|
|
32
|
+
/** A short label after the name, such as `beta`, with an optional tooltip on the site brand. */
|
|
33
|
+
badge?: {
|
|
34
|
+
label: string;
|
|
35
|
+
tooltip?: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
interface DocsStartOptions {
|
|
39
|
+
/** Id of the section that new readers open first, such as `getting-started`. */
|
|
40
|
+
section: string;
|
|
41
|
+
/**
|
|
42
|
+
* Site pages listed at the top of the start section, such as a tutorials catalog. They open inside the start section,
|
|
43
|
+
* and the header and the error page link to them. A link to the docs base reads "All docs" there.
|
|
44
|
+
*/
|
|
45
|
+
links?: DocsLink[];
|
|
46
|
+
}
|
|
47
|
+
interface DocsModuleOptions {
|
|
48
|
+
/** Folder of Markdown pages, relative to the app root. Defaults to `content`. A page's URL is its path in the folder. */
|
|
49
|
+
dir?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Pages from folders and Content Sources, replacing `dir`: a folder relative to the app root, a Source such as
|
|
52
|
+
* `github({ repo, root })` from `vite-hub/source`, or `{ source, mount?, exclude?, frontmatter? }`. The app-owned
|
|
53
|
+
* docsAssistant Workspace is configured separately.
|
|
54
|
+
*/
|
|
55
|
+
sources?: DocsSourceInput[];
|
|
56
|
+
/** Section metadata overrides, keyed by section id. */
|
|
57
|
+
sections?: Record<string, DocsSectionFile>;
|
|
58
|
+
/** Module exporting a default component map for Markdown tags. */
|
|
59
|
+
components?: string;
|
|
60
|
+
/**
|
|
61
|
+
* URL prefix whose folders are sections in the rail. Defaults to `/docs` when the content folder has a `docs/` folder,
|
|
62
|
+
* and to `/` when it has none, so the docs are the whole site. Mapped sources default to `/docs`.
|
|
63
|
+
*/
|
|
64
|
+
base?: string;
|
|
65
|
+
site?: DocsSiteOptions;
|
|
66
|
+
/** Order of section categories in the rail and the catalog. Sections of other categories come after them in the rail. */
|
|
67
|
+
categories?: string[];
|
|
68
|
+
/** Categories that the catalog lists but the rail leaves out, such as shared reference topics. */
|
|
69
|
+
railExclude?: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Rail items that hold several sections. The rail shows one item per group, and the sidebar of a member section
|
|
72
|
+
* lists every section of the group. A section joins a group here or with `group` in its `.navigation.yml`.
|
|
73
|
+
*/
|
|
74
|
+
groups?: DocsGroup[];
|
|
75
|
+
start?: DocsStartOptions;
|
|
76
|
+
/** Community links in the header on every page, such as a chat server. GitHub comes from `github`. */
|
|
77
|
+
socials?: DocsLink[];
|
|
78
|
+
/** Site pages linked at the end of every docs page, such as About and Privacy, so each one has a link to it. */
|
|
79
|
+
footer?: DocsLink[];
|
|
80
|
+
/** One line above every docs page, such as a release status. */
|
|
81
|
+
banner?: string;
|
|
82
|
+
/** More paths for `/sitemap.xml`, such as app pages outside the content folder. Every docs page is listed already. */
|
|
83
|
+
sitemap?: string[];
|
|
84
|
+
/** The repository of the site. `dir` is the content folder inside the repository. */
|
|
85
|
+
github?: {
|
|
86
|
+
repo: string;
|
|
87
|
+
branch?: string;
|
|
88
|
+
dir?: string;
|
|
89
|
+
} | false;
|
|
90
|
+
/** Icon maps of the rail and the sidebar. */
|
|
91
|
+
icons?: Partial<DocsIcons>;
|
|
92
|
+
/**
|
|
93
|
+
* The docs MCP server at `/mcp`, with the `list-pages` and `get-page` tools of Content. `name` is the server name that
|
|
94
|
+
* page actions suggest, and `guide` is the page that explains how to connect it. `false` turns it off.
|
|
95
|
+
*/
|
|
96
|
+
mcp?: {
|
|
97
|
+
name?: string;
|
|
98
|
+
guide?: string;
|
|
99
|
+
} | false;
|
|
100
|
+
/**
|
|
101
|
+
* More text for `/llms.txt`. `details` goes under the site description, such as rules for agents. `sections` adds
|
|
102
|
+
* sections of links, `[{ title, description?, links: [{ title, href, description? }] }]`, before the sections of pages.
|
|
103
|
+
*/
|
|
104
|
+
llms?: DocsLlmsOptions;
|
|
105
|
+
/**
|
|
106
|
+
* Checks links on prerendered pages with `nuxt-link-checker` and fails the build on detected errors.
|
|
107
|
+
* Also checks cross-page fragments against the final HTML output.
|
|
108
|
+
* Remote URLs are not fetched. Routes excluded by Nitro's prerender policy may be served at request time. A link to
|
|
109
|
+
* an exact `redirect` route rule passes, and the build checks instead that the rule leads to a docs page and hides
|
|
110
|
+
* none. Exclusion lists accept public paths, globs, or regular expressions. `false` turns the check off.
|
|
111
|
+
*/
|
|
112
|
+
linkChecker?: false | Pick<DocsLinkCheckOptions, "excludeLinks" | "excludePages" | "ignoreFragments" | "redirect">;
|
|
113
|
+
/**
|
|
114
|
+
* Checks every prerendered page as a site audit does: a sitemap URL that is not a prerendered page, a missing or
|
|
115
|
+
* duplicate title or description, a title outside 10 to 60 characters or a description outside 70 to 160, not exactly
|
|
116
|
+
* one `h1`, a skipped heading level, fewer than 150 words, or a page that no other page links to. Pages with `noindex`
|
|
117
|
+
* or a canonical link to another page are left out. `"warn"`, the default, logs the problems. `"error"` or `true` stops the
|
|
118
|
+
* build with `DOCS_SEO_FAILED`. `false` turns the check off.
|
|
119
|
+
*/
|
|
120
|
+
seoAudit?: "warn" | "error" | boolean;
|
|
121
|
+
/** The docs assistant: an Agent that answers from these pages. `true` uses the Agent named `docs`. */
|
|
122
|
+
assistant?: boolean | {
|
|
123
|
+
agent?: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* ViteHub Comments on every page, through `vite-hub/nuxt`. On by default when the app installs `vite-hub/nuxt`: the
|
|
127
|
+
* module sets its `comments` option to `true`, or to these options. Threads belong to the page path, and the Console
|
|
128
|
+
* lists them. `false` turns Comments off.
|
|
129
|
+
*/
|
|
130
|
+
comments?: boolean | DocsCommentsOptions;
|
|
131
|
+
/**
|
|
132
|
+
* Rewrites a page's Markdown before it becomes the copy that agents read at `/raw/<page>.md`, for example to expand
|
|
133
|
+
* a component into plain Markdown. The built-in rewrites run after it. Runs at build time, and the server keeps the
|
|
134
|
+
* pages that it changed.
|
|
135
|
+
*/
|
|
136
|
+
rawMarkdown?: (markdown: string, page: DocsPage) => string | Promise<string>;
|
|
137
|
+
/**
|
|
138
|
+
* A Markdown copy of every app page that is not a docs page, such as the home page, at its URL plus `.md` and for
|
|
139
|
+
* `Accept: text/markdown`. Content converts the HTML that the app renders for the same request. Docs pages keep their
|
|
140
|
+
* exact copy. `false` turns it off.
|
|
141
|
+
*/
|
|
142
|
+
markdownPages?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* The share image of every page, rendered by `nuxt-og-image` while the build prerenders. By default it shows the
|
|
145
|
+
* site, the page title and description, and the section. `component` names the app's own template in
|
|
146
|
+
* `components/OgImage/`, such as `Docs` for `OgImage/Docs.takumi.vue`; it gets the same props. A page sets
|
|
147
|
+
* `seo.image` to use a file of its own, or `false` for none. `false` here turns the images off.
|
|
148
|
+
*/
|
|
149
|
+
ogImage?: false | {
|
|
150
|
+
component?: string;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Path of a module, relative to the app root, whose default export is the parser options: `{ comarkUi, examples,
|
|
154
|
+
* plugins }`. Comark plugins and `examples.play` are functions, so they reach the server through a file and not
|
|
155
|
+
* through this config. The page route, search, and Console drafts parse with it.
|
|
156
|
+
*/
|
|
157
|
+
parser?: string;
|
|
158
|
+
/**
|
|
159
|
+
* The folder, relative to the app's source folder, of the Vue files that `::example{name}` shows. Defaults to
|
|
160
|
+
* `examples`, so `::example{name="ButtonExample"}` renders `app/examples/ButtonExample.vue` beside its source.
|
|
161
|
+
*/
|
|
162
|
+
examples?: string;
|
|
163
|
+
}
|
|
164
|
+
/** `llms` of the docs module options. */
|
|
165
|
+
interface DocsLlmsOptions {
|
|
166
|
+
details?: string;
|
|
167
|
+
sections?: ContentLlmsSection[];
|
|
168
|
+
}
|
|
169
|
+
/** The site mark: `mask` fills `src` with the text color, else `src` shows as it is, and `dark` in dark mode. */
|
|
170
|
+
interface DocsLogo {
|
|
171
|
+
src: string;
|
|
172
|
+
dark: string | null;
|
|
173
|
+
mask: boolean;
|
|
174
|
+
}
|
|
175
|
+
/** Options as the client and the server read them from `runtimeConfig.public.docs`. */
|
|
176
|
+
interface DocsPublicConfig {
|
|
177
|
+
appBase: string;
|
|
178
|
+
base: string;
|
|
179
|
+
site: {
|
|
180
|
+
name: string;
|
|
181
|
+
url: string;
|
|
182
|
+
description: string;
|
|
183
|
+
logo: DocsLogo | null;
|
|
184
|
+
badge: {
|
|
185
|
+
label: string;
|
|
186
|
+
tooltip: string | null;
|
|
187
|
+
} | null;
|
|
188
|
+
};
|
|
189
|
+
categories: string[];
|
|
190
|
+
railExclude: string[];
|
|
191
|
+
groups: DocsGroup[];
|
|
192
|
+
/** Absent without a `start` option. Nuxt turns a `null` in runtime config into an empty string. */
|
|
193
|
+
start?: {
|
|
194
|
+
section: string;
|
|
195
|
+
links: DocsLink[];
|
|
196
|
+
};
|
|
197
|
+
socials: DocsLink[];
|
|
198
|
+
footer: DocsLink[];
|
|
199
|
+
banner: string | null;
|
|
200
|
+
sitemap: string[];
|
|
201
|
+
/** `stars` is the repository's star count when the build could read it, else `null`. */
|
|
202
|
+
github: {
|
|
203
|
+
repo: string;
|
|
204
|
+
branch: string;
|
|
205
|
+
dir: string;
|
|
206
|
+
url: string;
|
|
207
|
+
stars: number | null;
|
|
208
|
+
} | false;
|
|
209
|
+
icons: DocsIcons;
|
|
210
|
+
mcp: {
|
|
211
|
+
name: string;
|
|
212
|
+
url: string;
|
|
213
|
+
guide: string | null;
|
|
214
|
+
} | false;
|
|
215
|
+
/** Whether app pages that are not docs pages get a converted Markdown copy. */
|
|
216
|
+
markdownPages: boolean;
|
|
217
|
+
assistant: {
|
|
218
|
+
agent: string;
|
|
219
|
+
} | false;
|
|
220
|
+
ogImage: {
|
|
221
|
+
component: string;
|
|
222
|
+
} | false;
|
|
223
|
+
}
|
|
224
|
+
declare module "nuxt/schema" {
|
|
225
|
+
interface PublicRuntimeConfig {
|
|
226
|
+
docs: DocsPublicConfig;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
declare module "nitro/types" {
|
|
230
|
+
interface NitroRuntimeConfig {
|
|
231
|
+
public: PublicRuntimeConfig;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
interface DocsNuxtModule {
|
|
235
|
+
(inlineOptions: DocsModuleOptions, nuxt: never): unknown;
|
|
236
|
+
getMeta?: () => Promise<Record<string, unknown>>;
|
|
237
|
+
}
|
|
238
|
+
declare const docsNuxtModule: DocsNuxtModule;
|
|
239
|
+
//#endregion
|
|
240
|
+
export { DocsPublicConfig as a, docsNuxtModule as c, DocsNuxtModule as i, DocsCommentsOptions as l, DocsLogo as n, DocsSiteOptions as o, DocsModuleOptions as r, DocsStartOptions as s, DocsLlmsOptions as t };
|
package/dist/nuxt.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as DocsPublicConfig, c as docsNuxtModule, i as DocsNuxtModule, l as DocsCommentsOptions, n as DocsLogo, o as DocsSiteOptions, r as DocsModuleOptions, s as DocsStartOptions, t as DocsLlmsOptions } from "./nuxt-B5LrERKc.js";
|
|
2
|
+
import { a as DocsThemeScope } from "./theme-BXyu4uFL.js";
|
|
3
|
+
export { type DocsCommentsOptions, DocsLlmsOptions, DocsLogo, DocsModuleOptions, DocsNuxtModule, DocsPublicConfig, DocsSiteOptions, DocsStartOptions, type DocsThemeScope, docsNuxtModule as default };
|