Skip to content

Commit 96ec3f9

Browse files
authored
feat(docs): add a plugin to generate documentation for LLMs (#3202)
1 parent c281d13 commit 96ec3f9

File tree

4 files changed

+134
-2
lines changed

4 files changed

+134
-2
lines changed

.vitepress/config.ts

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import fs from 'fs'
22
import path from 'path'
3-
import { defineConfigWithTheme, type HeadConfig } from 'vitepress'
3+
import { defineConfigWithTheme, type HeadConfig, type Plugin } from 'vitepress'
44
import type { Config as ThemeConfig } from '@vue/theme'
5+
import llmstxt from 'vitepress-plugin-llms'
56
import baseConfig from '@vue/theme/config'
67
import { headerPlugin } from './headerMdPlugin'
78
// import { textAdPlugin } from './textAdMdPlugin'
@@ -788,6 +789,30 @@ export default defineConfigWithTheme<ThemeConfig>({
788789
},
789790
json: {
790791
stringify: true
791-
}
792+
},
793+
plugins: [
794+
llmstxt({
795+
ignoreFiles: [
796+
'about/team/**/*',
797+
'about/team.md',
798+
'about/privacy.md',
799+
'about/coc.md',
800+
'developers/**/*',
801+
'ecosystem/themes.md',
802+
'examples/**/*',
803+
'partners/**/*',
804+
'sponsor/**/*',
805+
'index.md'
806+
],
807+
customLLMsTxtTemplate: `\
808+
# Vue.js
809+
810+
Vue.js - The Progressive JavaScript Framework
811+
812+
## Table of Contents
813+
814+
{toc}`
815+
}) as Plugin
816+
]
792817
}
793818
})

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@types/markdown-it": "^14.1.2",
2424
"@types/node": "^22.7.5",
2525
"typescript": "^5.6.3",
26+
"vitepress-plugin-llms": "^0.0.8",
2627
"vue-tsc": "^2.1.6"
2728
},
2829
"packageManager": "[email protected]"

pnpm-lock.yaml

+101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/_redirects

+5
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,8 @@
6161
/v2/guide/reactivity.html /guide/extras/reactivity-in-depth.html
6262

6363
/v2/* https://v2.vuejs.org/v2/:splat?redirect=true 302
64+
65+
/*.txt /:splat.md 301
66+
/llms.md /llms.txt 301
67+
/llms.txt /llms.txt 200!
68+
/llms-full.txt /llms-full.txt 200!

0 commit comments

Comments
 (0)