@verbb/vitepress-theme 1.0.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/README.md +41 -0
- package/package.json +32 -0
- package/src/Layout.vue +1077 -0
- package/src/components/DocsIcon.vue +100 -0
- package/src/components/DocsMobileMenu.vue +68 -0
- package/src/components/DocsMobileMenuNode.vue +114 -0
- package/src/components/DocsNotFound.vue +41 -0
- package/src/components/DocsOutline.vue +284 -0
- package/src/components/DocsOutlineItem.vue +65 -0
- package/src/components/DocsSearchProvider.vue +51 -0
- package/src/components/DocsSidebar.vue +41 -0
- package/src/components/DocsSidebarNode.vue +114 -0
- package/src/custom.css +547 -0
- package/src/env.d.ts +8 -0
- package/src/index.ts +22 -0
- package/src/search.ts +17 -0
- package/src/sidebar.ts +218 -0
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# @verbb/vitepress-theme
|
|
2
|
+
|
|
3
|
+
Shared VitePress theme used by Verbb documentation sites (custom layout, sidebar, outline, local search, primary-color tokens).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Add the package and peer dependencies (`vitepress`, `vue`), plus Tailwind v4 with `@tailwindcss/vite` and `@tailwindcss/typography` so `src/custom.css` can be processed.
|
|
8
|
+
2. In `.vitepress/theme/index.ts`:
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import type { Theme } from 'vitepress';
|
|
12
|
+
import { createVerbbDocsTheme } from '@verbb/vitepress-theme';
|
|
13
|
+
|
|
14
|
+
const theme: Theme = createVerbbDocsTheme({
|
|
15
|
+
enhanceApp({ app }) {
|
|
16
|
+
// app.component('MyPreview', MyPreview);
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default theme;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. In VitePress config, ensure the theme is compiled (not externalized) during SSR:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
vite: {
|
|
27
|
+
ssr: { noExternal: ['@verbb/vitepress-theme'] },
|
|
28
|
+
plugins: [tailwindcss()],
|
|
29
|
+
},
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
4. Set `themeConfig.nav` for top-of-site section links (shown as a dropdown). Leave `nav` empty or omit it to hide the control.
|
|
33
|
+
|
|
34
|
+
5. Optional: `themeConfig.docsTheme.primary` (and other `docsTheme` keys) override CSS variables for accent colors.
|
|
35
|
+
|
|
36
|
+
## Local `file:` dependency paths
|
|
37
|
+
|
|
38
|
+
Point `file:` at this folder from the package that runs VitePress. Examples from this workspace:
|
|
39
|
+
|
|
40
|
+
- `formie-plugin-repo/packages/docs` → `file:../../../verbb-vitepress-theme`
|
|
41
|
+
- `plugin-kit-repo/plugin-kit-react` → `file:../../verbb-vitepress-theme` (two levels up to `formie-react`, not three)
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@verbb/vitepress-theme",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared VitePress theme (layout, sidebar, local search) for Verbb documentation sites.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.css"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./src/index.ts",
|
|
12
|
+
"import": "./src/index.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"vitepress": "^1.6.4",
|
|
23
|
+
"vue": "^3.5.33"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@tailwindcss/typography": "^0.5.19",
|
|
27
|
+
"tailwindcss": "^4.2.4",
|
|
28
|
+
"typescript": "^6.0.3",
|
|
29
|
+
"vitepress": "^1.6.4",
|
|
30
|
+
"vue": "^3.5.33"
|
|
31
|
+
}
|
|
32
|
+
}
|