Skip to content

Commit b15fb83

Browse files
committed
feat: integrate vitepress-plugin-llms for enhanced documentation capabilities and remove the generateLLms script
1 parent 23493de commit b15fb83

File tree

6 files changed

+463
-114
lines changed

6 files changed

+463
-114
lines changed

.vitepress/config.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from 'path';
33
import { defineConfig, resolveSiteDataByRoute, type HeadConfig } from 'vitepress';
44
import { chineseSearchOptimize, pagefindPlugin } from 'vitepress-plugin-pagefind';
55
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons';
6+
import llmstxt, { copyOrDownloadAsMarkdownButtons } from 'vitepress-plugin-llms'
67
import { headerPlugin } from './headerMdPlugin';
78
import { baseURL } from './meta';
89

@@ -97,6 +98,7 @@ export default defineConfig({
9798
config(md) {
9899
md.use(headerPlugin);
99100
md.use(groupIconMdPlugin);
101+
md.use(copyOrDownloadAsMarkdownButtons);
100102
}
101103
},
102104

@@ -148,11 +150,15 @@ export default defineConfig({
148150
customIcon: {
149151
cloudflare: 'logos:cloudflare-workers-icon'
150152
}
153+
}),
154+
llmstxt({
155+
ignoreFiles: ['src/index.md', 'README.md', 'zh/**/*'],
156+
description: 'WinJS - A Plugin-based Frontend Application Framework',
157+
details: `\
158+
- WinJS is an extensible frontend application framework. Built on a routing foundation, it supports both configured and conventional routing, ensuring comprehensive routing functionality for feature extensions. It also features a comprehensive plugin system with full lifecycle support, covering every stage from source code to build artifacts, supporting various functional extensions and business requirements.
159+
`
151160
})
152-
],
153-
experimental: {
154-
enableNativePlugin: true
155-
}
161+
]
156162
},
157163

158164
transformPageData: prod

.vitepress/theme/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import VersionTag from './components/VersionTag.vue';
1111
import SpecialRemark from './components/SpecialMark.vue';
1212
import ImagePreview from './components/ImagePreview.vue';
1313
import 'virtual:group-icons.css';
14+
import CopyOrDownloadAsMarkdownButtons
15+
from 'vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue';
1416

1517
import './styles/vars.css';
1618
import type { EnhanceAppContext } from 'vitepress/dist/client';
@@ -30,5 +32,6 @@ export default Object.assign({}, Theme, {
3032
ctx.app.component('VersionTag', VersionTag);
3133
ctx.app.component('SpecialRemark', SpecialRemark);
3234
ctx.app.component('ImagePreview', ImagePreview);
35+
ctx.app.component('CopyOrDownloadAsMarkdownButtons', CopyOrDownloadAsMarkdownButtons);
3336
}
3437
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"packageManager": "[email protected]",
77
"scripts": {
88
"dev": "vitepress",
9-
"build": "vitepress build && node scripts/generateLLms.cjs",
9+
"build": "vitepress build",
1010
"serve": "vitepress serve",
1111
"zhlint": "zhlint 'src/{api,blog,cli,config,guide,plugins}/**/*.md'",
1212
"clean": "rm -rf .vitepress/dist",
@@ -30,6 +30,7 @@
3030
"glob": "^11.0.1",
3131
"vitepress-plugin-group-icons": "^1.6.1",
3232
"vitepress-plugin-pagefind": "^0.4.14",
33+
"vitepress-plugin-llms": "^1.8.0",
3334
"terser": "^5.14.2",
3435
"zhlint": "^0.8.0"
3536
},

0 commit comments

Comments
 (0)