Skip to content

Commit

Permalink
支持图表
Browse files Browse the repository at this point in the history
  • Loading branch information
laizuan committed Jul 17, 2023
1 parent cb3581c commit dfbacaf
Show file tree
Hide file tree
Showing 5 changed files with 829 additions and 193 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ yarn-error.log*
*.sln
*.sw?

cache/
dist/
.temp
4 changes: 2 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ignore-workspace-root-check=true
strict-peer-dependencies=false
shell-emulator=true
registry=https://registry.npmjs.org
# registry=https://registry.npmmirror.com/
# registry=https://registry.npmjs.org
registry=https://registry.npmmirror.com/
# registry=https://devops.leaderrun.com/nexus/repository/npm-group/
159 changes: 81 additions & 78 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const base = process.env.BASE || '/'
const nav = require('./configs/nav')
const sidebar = require('./configs/sidebar')
const externalGlobals = require('rollup-plugin-external-globals')
import { withMermaid } from 'vitepress-plugin-mermaid'
import plantuml from 'markdown-it-plantuml'
// import { demoBlockPlugin } from 'vitepress-theme-demoblock'
function MdCustomAttrPugin(md, type, mdOptions = null) {
Expand All @@ -19,88 +20,90 @@ function MdCustomAttrPugin(md, type, mdOptions = null) {
}
}

export default defineConfig({
title: 'Seetltd 官方文档',
description: '前后端低代码解决方案',
head: [
[
'link',
{ rel: 'stylesheet', href: '/css/fancybox.min.css' },
{ rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }
export default withMermaid(
defineConfig({
title: 'Seetltd 官方文档',
description: '前后端低代码解决方案',
head: [
[
'link',
{ rel: 'stylesheet', href: '/css/fancybox.min.css' },
{ rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }
],
['script', { src: '/js/fancybox.min.js' }]
],
['script', { src: '/js/fancybox.min.js' }]
],
base: base,
lang: 'zh-CN',
appearance: true,
lastUpdated: true,
vite: {
plugins: [
externalGlobals({
vuedraggable: 'vuedraggable'
})
]
},
themeConfig: {
logo: '/logo.svg',
// docsDir: 'docs',
algolia: {
appId: '8TBF6K4PZU',
apiKey: '0980bf516b159e87fc81e03ecb896ce4',
indexName: 'seedltd-online-docs'
base: base,
lang: 'zh-CN',
appearance: true,
lastUpdated: true,
vite: {
plugins: [
externalGlobals({
vuedraggable: 'vuedraggable'
})
]
},
themeConfig: {
logo: '/logo.svg',
// docsDir: 'docs',
algolia: {
appId: '8TBF6K4PZU',
apiKey: '0980bf516b159e87fc81e03ecb896ce4',
indexName: 'seedltd-online-docs'
},

// nav
nav,
// nav
nav,

// sidebar
sidebar,
lastUpdatedText: '上次更新',
footer: {
message: '粤ICP备2022017444号',
copyright: 'Copyright © 2019-present Seetltd'
}
},
// sidebar
sidebar,
lastUpdatedText: '上次更新',
footer: {
message: '粤ICP备2022017444号',
copyright: 'Copyright © 2019-present Seetltd'
}
},

markdown: {
// options for markdown-it-anchor
anchor: { permalink: false },
markdown: {
// options for markdown-it-anchor
anchor: { permalink: false },

// options for markdown-it-toc
toc: { includeLevel: [1, 2] },
config: (md) => {
// md.use(demoBlockPlugin, {
// cssPreprocessor: 'scss',
// scriptImports: [
// "import * as ElementPlus from 'element-plus'",
// "import * as ElementPlus from 'element-next'"
// ],
// scriptReplaces: [
// {
// searchValue: /const ({ defineComponent as _defineComponent }) = Vue/g,
// replaceValue: 'const { defineComponent: _defineComponent } = Vue'
// },
// {
// searchValue: /import ({.*}) from 'element-plus'/g,
// replaceValue: (s, s1) => `const ${s1} = ElementPlus`
// },
// {
// searchValue: /const ({ defineComponent as _defineComponent }) = Vue/g,
// replaceValue: 'const { defineComponent: _defineComponent } = Vue'
// },
// {
// searchValue: /import ({.*}) from 'element-next'/g,
// replaceValue: (s, s1) => `const ${s1} = ElementNext`
// }
// ]
// })
md.use(MdCustomAttrPugin, 'image', {
'data-fancybox': 'gallery'
})
md.use(plantuml, {
openMarker: '```plantuml',
closeMarker: '```'
})
// options for markdown-it-toc
toc: { includeLevel: [1, 2] },
config: (md) => {
// md.use(demoBlockPlugin, {
// cssPreprocessor: 'scss',
// scriptImports: [
// "import * as ElementPlus from 'element-plus'",
// "import * as ElementPlus from 'element-next'"
// ],
// scriptReplaces: [
// {
// searchValue: /const ({ defineComponent as _defineComponent }) = Vue/g,
// replaceValue: 'const { defineComponent: _defineComponent } = Vue'
// },
// {
// searchValue: /import ({.*}) from 'element-plus'/g,
// replaceValue: (s, s1) => `const ${s1} = ElementPlus`
// },
// {
// searchValue: /const ({ defineComponent as _defineComponent }) = Vue/g,
// replaceValue: 'const { defineComponent: _defineComponent } = Vue'
// },
// {
// searchValue: /import ({.*}) from 'element-next'/g,
// replaceValue: (s, s1) => `const ${s1} = ElementNext`
// }
// ]
// })
md.use(MdCustomAttrPugin, 'image', {
'data-fancybox': 'gallery'
})
md.use(plantuml, {
openMarker: '```plantuml',
closeMarker: '```'
})
}
}
}
})
})
)
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
"devDependencies": {
"cross-env": "^7.0.3",
"markdown-it-plantuml": "^1.4.1",
"mermaid": "^10.2.4",
"prettier": "^2.5.1",
"rollup-plugin-external-globals": "^0.6.1",
"sass": "^1.45.0",
"vitepress": "1.0.0-beta.2"
"vitepress": "1.0.0-beta.2",
"vitepress-plugin-mermaid": "^2.0.13"
},
"engines": {
"node": ">=16.0.0"
Expand Down
Loading

0 comments on commit dfbacaf

Please sign in to comment.