fix: 启用 Mermaid 图表渲染支持
- 安装 vitepress-plugin-mermaid 和 mermaid 依赖 - 使用 withMermaid 包装 VitePress 配置 - 配置 Mermaid 插件和 Vite 优化 - 移除重复的 mermaid 配置项 修复问题: - 流程图和架构图现在可以正确渲染为图形 - 不再显示为纯文本代码 Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
This commit is contained in:
@@ -1,10 +1,19 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
import { withMermaid } from 'vitepress-plugin-mermaid'
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default defineConfig({
|
||||
export default withMermaid(defineConfig({
|
||||
title: "LJWX Docs",
|
||||
description: "知识资产化系统文档",
|
||||
|
||||
// Mermaid 配置
|
||||
mermaid: {
|
||||
// 可选:自定义 Mermaid 配置
|
||||
},
|
||||
mermaidPlugin: {
|
||||
class: 'mermaid'
|
||||
},
|
||||
|
||||
// 多语言配置
|
||||
locales: {
|
||||
root: {
|
||||
@@ -181,11 +190,6 @@ export default defineConfig({
|
||||
]
|
||||
},
|
||||
|
||||
// Mermaid 图表支持
|
||||
mermaid: {
|
||||
// Mermaid 配置
|
||||
},
|
||||
|
||||
// 启用 MermaidJS
|
||||
vite: {
|
||||
optimizeDeps: {
|
||||
@@ -197,4 +201,4 @@ export default defineConfig({
|
||||
build: {
|
||||
outDir: '../dist'
|
||||
}
|
||||
})
|
||||
}))
|
||||
|
||||
+3
-1
@@ -23,12 +23,14 @@
|
||||
"author": "brunogao",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"mermaid": "^11.12.2",
|
||||
"vitepress": "^1.0.1",
|
||||
"vitepress-plugin-mermaid": "^2.0.17",
|
||||
"vue": "^3.4.19"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
"compression": "^1.7.4",
|
||||
"express": "^4.18.2",
|
||||
"sirv": "^2.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user