Skip to content

Commit d53f8f3

Browse files
committed
docs: update gen llm
1 parent b18dc79 commit d53f8f3

File tree

4 files changed

+197
-17
lines changed

4 files changed

+197
-17
lines changed

docs/.vitepress/config.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'vitepress';
2-
import { defaultHoverInfoProcessor, transformerTwoslash } from '@shikijs/vitepress-twoslash';
3-
import { transformerRemoveNotationEscape, transformerNotationDiff } from '@shikijs/transformers';
2+
import llmstxt from 'vitepress-plugin-llms';
3+
import { copyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms';
4+
45
import { getLocaleConfig } from './locale';
56
import { transformHead } from './transformHead';
67

@@ -12,6 +13,9 @@ export default defineConfig({
1213
locales: {
1314
root: getLocaleConfig('en'),
1415
},
16+
vite: {
17+
plugins: [llmstxt()]
18+
},
1519
themeConfig: {
1620
search: {
1721
provider: 'local',
@@ -42,6 +46,11 @@ export default defineConfig({
4246
hostname: docsLink,
4347
},
4448
transformHead,
49+
markdown: {
50+
config(md) {
51+
md.use(copyOrDownloadAsMarkdownButtons);
52+
}
53+
}
4554
// markdown: {
4655
// codeTransformers: [
4756
// {

docs/.vitepress/theme/index.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
import Theme from 'vitepress/theme'
1+
import type { EnhanceAppContext } from 'vitepress';
2+
import Theme from 'vitepress/theme';
3+
24
// import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
3-
import type { EnhanceAppContext } from 'vitepress'
4-
import './style.css'
5+
import './style.css';
56
// import '@nolebase/vitepress-plugin-git-changelog/client/style.css'
67
// import '@shikijs/vitepress-twoslash/style.css'
7-
import Contributors from '../components/Contributors.vue'
8-
import Changelog from '../components/Changelog.vue'
9-
import Layout from './Layout.vue'
10-
import 'uno.css'
8+
import Layout from './Layout.vue';
9+
import Changelog from '../components/Changelog.vue';
10+
import Contributors from '../components/Contributors.vue';
11+
12+
import 'uno.css';
13+
import CopyOrDownloadAsMarkdownButtons from 'vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue';
1114

1215
export default {
1316
...Theme,
1417
Layout,
1518
enhanceApp({ app }: EnhanceAppContext) {
16-
app.component('Contributors', Contributors)
17-
app.component('Changelog', Changelog)
19+
app.component('Contributors', Contributors);
20+
app.component('Changelog', Changelog);
21+
app.component('CopyOrDownloadAsMarkdownButtons', CopyOrDownloadAsMarkdownButtons);
1822

1923
// app.use(TwoslashFloatingVue)
2024
},
21-
}
25+
};

docs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"unocss": "^0.62.1",
2222
"vite": "^5.4.0",
2323
"vitepress": "^1.3.2",
24+
"vitepress-plugin-llms": "^1.10.0",
2425
"vue": "^3.4.37"
2526
}
2627
}

0 commit comments

Comments
 (0)