Skip to content

Commit 985fe24

Browse files
committed
update starus docs
1 parent b78fb76 commit 985fe24

File tree

2 files changed

+66
-10
lines changed

2 files changed

+66
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ docs/node_modules
1313
docs/.vitepress/cache
1414
docs/.vitepress/dist
1515
docs/.DS_Store
16-
docs/package-lock.json
16+
docs/package-lock.json
17+
.qodo

docs/src/manual/repo_stars.md

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,34 @@ And make sure you have the following highlighted elements:
3131
```ts [index.ts]
3232
// .vitepress/theme/index.ts
3333
import { h } from 'vue'
34-
import type { Theme } from 'vitepress'
3534
import DefaultTheme from 'vitepress/theme'
36-
import VersionPicker from "../../components/VersionPicker.vue"
37-
import StarUs from '../../components/StarUs.vue' // [!code focus]
38-
import AuthorBadge from '../../components/AuthorBadge.vue'
39-
import Authors from '../../components/Authors.vue'
35+
import type { Theme as ThemeConfig } from 'vitepress'
36+
37+
import {
38+
NolebaseEnhancedReadabilitiesMenu,
39+
NolebaseEnhancedReadabilitiesScreenMenu,
40+
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client'
41+
42+
import VersionPicker from "@/components/VersionPicker.vue"
43+
import StarUs from '@/components/StarUs.vue' // [!code focus]
44+
import AuthorBadge from '@/components/AuthorBadge.vue'
45+
import Authors from '@/components/Authors.vue'
4046
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
47+
48+
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
4149
import './style.css'
50+
import './docstrings.css'
4251

43-
export default {
52+
export const Theme: ThemeConfig = {
4453
extends: DefaultTheme,
4554
Layout() {
4655
return h(DefaultTheme.Layout, null, {
47-
'nav-bar-content-after': () => h(StarUs), // [!code focus]
56+
'nav-bar-content-after': () => [
57+
h(StarUs), // [!code focus]
58+
h(NolebaseEnhancedReadabilitiesMenu), // Enhanced Readabilities menu
59+
],
60+
// A enhanced readabilities menu for narrower screens (usually smaller than iPad Mini)
61+
'nav-screen-content-after': () => h(NolebaseEnhancedReadabilitiesScreenMenu),
4862
})
4963
},
5064
enhanceApp({ app, router, siteData }) {
@@ -53,14 +67,16 @@ export default {
5367
app.component('AuthorBadge', AuthorBadge)
5468
app.component('Authors', Authors)
5569
}
56-
} satisfies Theme
70+
}
71+
export default Theme
5772
```
5873

5974
```json [package.json]
6075
{
6176
"devDependencies": {
77+
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.15.0",
6278
"@types/d3-format": "^3.0.4", // [!code focus]
63-
"@types/node": "^22.10.5", // [!code focus]
79+
"@types/node": "^22.13.9", // [!code focus]
6480
"markdown-it": "^14.1.0",
6581
"markdown-it-mathjax3": "^4.3.2",
6682
"vitepress": "^1.5.0",
@@ -79,4 +95,43 @@ export default {
7995

8096
```
8197

98+
:::
99+
100+
Please see that your `config.mts` file now also includes:
101+
102+
::: warning
103+
104+
```ts [config.mts]
105+
import path from 'path'
106+
107+
export default defineConfig({
108+
vite: {
109+
resolve: {
110+
alias: {
111+
'@': path.resolve(__dirname, '../components')
112+
}
113+
},
114+
build: {
115+
assetsInlineLimit: 0, // so we can tell whether we have created inlined images or not, we don't let vite inline them
116+
},
117+
optimizeDeps: {
118+
exclude: [
119+
'@nolebase/vitepress-plugin-enhanced-readabilities/client',
120+
'vitepress',
121+
'@nolebase/ui',
122+
],
123+
},
124+
ssr: {
125+
noExternal: [
126+
// If there are other packages that need to be processed by Vite, you can add them here.
127+
'@nolebase/vitepress-plugin-enhanced-readabilities',
128+
'@nolebase/ui',
129+
],
130+
},
131+
},
132+
133+
})
134+
135+
```
136+
82137
:::

0 commit comments

Comments
 (0)