Skip to content

Commit 01b02ba

Browse files
committed
feat: add plugin-markdown-chart
1 parent 5209825 commit 01b02ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+6845
-109
lines changed

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,20 @@
2222
"artalk",
2323
"bumpp",
2424
"commitlint",
25+
"chartjs",
2526
"composables",
2627
"darkmode",
2728
"devtool",
2829
"docsearch",
2930
"domhandler",
31+
"echarts",
3032
"envinfo",
3133
"esbuild",
3234
"execa",
3335
"fflate",
3436
"frontmatter",
3537
"fullscreen",
38+
"gantt",
3639
"giscus",
3740
"globby",
3841
"gtag",
@@ -41,16 +44,19 @@
4144
"lazyload",
4245
"lightmode",
4346
"linkify",
47+
"markmap",
4448
"mathjax",
4549
"mdit",
4650
"meteorlxy",
51+
"mindmap",
4752
"nord",
4853
"npmmirror",
4954
"nprogress",
5055
"pageview",
5156
"pageviews",
5257
"pengzhanbo",
5358
"photoswipe",
59+
"plantuml",
5460
"prefetch",
5561
"preload",
5662
"prismjs",

docs/.vuepress/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { commentPlugin } from '@vuepress/plugin-comment'
88
import { docsearchPlugin } from '@vuepress/plugin-docsearch'
99
import { feedPlugin } from '@vuepress/plugin-feed'
1010
import { markdownExtPlugin } from '@vuepress/plugin-markdown-ext'
11+
import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart'
1112
import { markdownImagePlugin } from '@vuepress/plugin-markdown-image'
1213
import { markdownIncludePlugin } from '@vuepress/plugin-markdown-include'
1314
import { markdownMathPlugin } from '@vuepress/plugin-markdown-math'
@@ -85,6 +86,14 @@ export default defineUserConfig({
8586
json: true,
8687
rss: true,
8788
}),
89+
markdownChartPlugin({
90+
chartjs: true,
91+
echarts: true,
92+
flowchart: true,
93+
markmap: true,
94+
mermaid: true,
95+
plantuml: true,
96+
}),
8897
markdownExtPlugin({
8998
gfm: true,
9099
component: true,

docs/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@vuepress/plugin-copy-code": "workspace:*",
2020
"@vuepress/plugin-docsearch": "workspace:*",
2121
"@vuepress/plugin-feed": "workspace:*",
22+
"@vuepress/plugin-markdown-chart": "workspace:*",
2223
"@vuepress/plugin-markdown-ext": "workspace:*",
2324
"@vuepress/plugin-markdown-image": "workspace:*",
2425
"@vuepress/plugin-markdown-include": "workspace:*",
@@ -35,8 +36,15 @@
3536
"@vuepress/plugin-search": "workspace:*",
3637
"@vuepress/plugin-shiki": "workspace:*",
3738
"@vuepress/theme-default": "workspace:*",
39+
"chart.js": "4.4.6",
40+
"echarts": "5.5.1",
41+
"flowchart.ts": "3.0.1",
3842
"katex": "0.16.11",
43+
"markmap-lib": "0.17.2",
44+
"markmap-toolbar": "0.17.2",
45+
"markmap-view": "0.17.2",
3946
"mathjax-full": "3.2.2",
47+
"mermaid": "11.4.0",
4048
"sass-embedded": "1.81.0",
4149
"sass-loader": "^16.0.3",
4250
"vue": "^3.5.13",
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# markdown-chart
2+
3+
<NpmBadge package="@vuepress/plugin-markdown-chart" />
4+
5+
Add powerful charts to your VuePress site.
6+
7+
This plugin provides 6 ways to let you insert charts into your markdown file.
8+
9+
- chart.js: A lightweight, easy-to-use, highly customizable chart library.
10+
11+
chart.js is lighter comparing to echarts.
12+
13+
- echarts: A powerful, interactive charting and visualization library for browser.
14+
15+
echarts is more powerful comparing to chart.js.
16+
17+
- Flowchart: A simple markdown extension to generate flowcharts and sequence diagrams.
18+
19+
Lightweight, only focusing on flowcharts.
20+
21+
- Markmap: Create mindmap with markdown
22+
23+
The runtime is very heavy, not recommended.
24+
25+
- Mermaid: Generation of diagram and flowchart from text in a similar manner as markdown.
26+
27+
Powerful collection of common charts.
28+
29+
- Plantuml: UML diagram driven by Java.
30+
31+
No runtime, diagram render is processed on plantuml server.
32+
33+
## Usage
34+
35+
```bash
36+
npm i -D @vuepress/plugin-markdown-chart@next
37+
```
38+
39+
```ts
40+
import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart'
41+
42+
export default {
43+
plugins: [
44+
markdownChartPlugin({
45+
// Enable chart.js
46+
chartjs: true,
47+
// Enable echarts
48+
echarts: true,
49+
// Enable flowchart.ts
50+
flowchart: true,
51+
// Enable markmap
52+
markmap: true,
53+
// Enable mermaid
54+
mermaid: true,
55+
}),
56+
],
57+
}
58+
```

0 commit comments

Comments
 (0)