Skip to content

Commit 55b5cc4

Browse files
committed
feat(docs): add a plugin to generate documentation for LLMs
1 parent d770157 commit 55b5cc4

File tree

3 files changed

+129
-2
lines changed

3 files changed

+129
-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'
@@ -783,6 +784,30 @@ export default defineConfigWithTheme<ThemeConfig>({
783784
},
784785
json: {
785786
stringify: true
786-
}
787+
},
788+
plugins: [
789+
llmstxt({
790+
ignoreFiles: [
791+
'about/team/**/*',
792+
'about/team.md',
793+
'about/privacy.md',
794+
'about/coc.md',
795+
'developers/**/*',
796+
'ecosystem/themes.md',
797+
'examples/**/*',
798+
'partners/**/*',
799+
'sponsor/**/*',
800+
'index.md'
801+
],
802+
customLLMsTxtTemplate: `\
803+
# Vue.js
804+
805+
Vue.js - The Progressive JavaScript Framework
806+
807+
## Table of Contents
808+
809+
{toc}`
810+
}) as Plugin
811+
]
787812
}
788813
})

package.json

Lines changed: 1 addition & 0 deletions
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

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

0 commit comments

Comments
 (0)