Skip to content

Commit 0952d94

Browse files
authored
feat(docs): add a plugin to generate documentation for LLMs (#2558)
1 parent 25efd39 commit 0952d94

File tree

4 files changed

+100
-2
lines changed

4 files changed

+100
-2
lines changed

.vitepress/config.ts

Lines changed: 27 additions & 2 deletions
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'
@@ -822,6 +823,30 @@ export default defineConfigWithTheme<ThemeConfig>({
822823
},
823824
json: {
824825
stringify: true
825-
}
826+
},
827+
plugins: [
828+
llmstxt({
829+
ignoreFiles: [
830+
'about/team/**/*',
831+
'about/team.md',
832+
'about/privacy.md',
833+
'about/coc.md',
834+
'developers/**/*',
835+
'ecosystem/themes.md',
836+
'examples/**/*',
837+
'partners/**/*',
838+
'sponsor/**/*',
839+
'index.md'
840+
],
841+
customLLMsTxtTemplate: `\
842+
# Vue.js
843+
844+
Vue.js - The Progressive JavaScript Framework
845+
846+
## Table of Contents
847+
848+
{toc}`
849+
}) as Plugin
850+
]
826851
}
827852
})

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"textlint-filter-rule-comments": "^1.2.2",
3131
"textlint-rule-preset-vuejs-jp": "github:vuejs-jp/textlint-rule-preset-vuejs-jp",
3232
"typescript": "^5.6.3",
33+
"vitepress-plugin-llms": "^0.0.8",
3334
"vue-tsc": "^2.1.6"
3435
},
3536
"gitHooks": {

pnpm-lock.yaml

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/_redirects

Lines changed: 5 additions & 0 deletions
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)