Skip to content

Commit

Permalink
fix(plugin): edit token mermaid -> mermaidjs, remove plugin-markmap
Browse files Browse the repository at this point in the history
  • Loading branch information
Renovamen committed Nov 22, 2021
1 parent d9a9796 commit f89a7a6
Show file tree
Hide file tree
Showing 23 changed files with 4,052 additions and 3,734 deletions.
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- 文章目录
- 多种代码高亮主题,支持代码块全屏(从 WordPress 主题 [Sakura](https://github.com/mashirozx/Sakura) 搬过来的功能)
- 基于 [Katex](https://github.com/KaTeX/KaTeX) 的公式支持
- 在文章中使用图表:[Chart.js](https://www.chartjs.org)[Mermaid](https://mermaid-js.github.io)[roughViz.js](https://github.com/jwilber/roughViz)[markmap](https://github.com/gera2ld/markmap)
- 在文章中使用图表:[Chart.js](https://www.chartjs.org)[Mermaid](https://mermaid-js.github.io)[roughViz.js](https://github.com/jwilber/roughViz)
- 一些 Markdown 增强样式,目前支持:
- 脚注(基于 [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote)
- 高亮(基于 [markdown-it-mark](https://github.com/markdown-it/markdown-it-mark)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ V2 is still **WIP**, see [v2](https://github.com/Renovamen/vuepress-theme-gungni
- Table of contents
- Multiple syntax highlighting themes, support full screening the code blocks (inspired by WordPress theme [Sakura](https://github.com/mashirozx/Sakura))
- Tex support ([KaTex](https://github.com/KaTeX/KaTeX))
- Draw charts and graphs in Markdown easily: [Chart.js](https://www.chartjs.org), [Mermaid](https://mermaid-js.github.io), [roughViz.js](https://github.com/jwilber/roughViz) and [markmap](https://github.com/gera2ld/markmap)
- Draw charts and graphs in Markdown easily: [Chart.js](https://www.chartjs.org), [Mermaid](https://mermaid-js.github.io) and [roughViz.js](https://github.com/jwilber/roughViz)
- Markdown enhancements:
- Footnote ([markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote))
- Mark ([markdown-it-mark](https://github.com/markdown-it/markdown-it-mark))
Expand Down
1 change: 0 additions & 1 deletion docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ module.exports = {
mermaid: true,
chartjs: true,
roughviz: true,
markmap: true,
mdPlus: {
all: true
},
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/configs/sidebar/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
"plugins/chart",
"plugins/mermaid",
"plugins/roughviz",
"plugins/markmap",
// "plugins/markmap",
"plugins/katex",
"plugins/md-plus",
"plugins/reading-time",
Expand Down
2 changes: 1 addition & 1 deletion docs/.vuepress/configs/sidebar/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = {
"plugins/chart",
"plugins/mermaid",
"plugins/roughviz",
"plugins/markmap",
// "plugins/markmap",
"plugins/katex",
"plugins/md-plus",
"plugins/reading-time",
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Gungnir is the spear of the god Odin in Norse mythology, made from the wood of t
- Table of contents
- Multiple syntax highlighting themes, support full screening the code blocks (inspired by WordPress theme [Sakura](https://github.com/mashirozx/Sakura))
- Tex support ([Katex](https://github.com/KaTeX/KaTeX))
- Draw charts and graphs in Markdown easily: [Chart.js](https://www.chartjs.org), [Mermaid](https://mermaid-js.github.io), [roughViz.js](https://github.com/jwilber/roughViz) and [markmap](https://github.com/gera2ld/markmap)
- Draw charts and graphs in Markdown easily: [Chart.js](https://www.chartjs.org), [Mermaid](https://mermaid-js.github.io) and [roughViz.js](https://github.com/jwilber/roughViz)
- Markdown enhancements:
- Footnote ([markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote))
- Mark ([markdown-it-mark](https://github.com/markdown-it/markdown-it-mark))
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/advanced/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ themeConfig: {

The token info of the code block should be `mermaid`, for example:

```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand All @@ -254,7 +254,7 @@ sequenceDiagram

::: details Code
~~~
```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand Down Expand Up @@ -342,7 +342,7 @@ To load a local `csv` file, a feasible way is to put your `csv` file under `.vue
Refer to the [documentation of roughViz.js](https://github.com/jwilber/roughViz) for more information.


### markmap
<!-- ### markmap
Use [markmap](https://github.com/gera2ld/markmap) via [plugin-markmap](/docs/plugins/markmap/) to create creating mind map in Markdown:
Expand Down Expand Up @@ -390,7 +390,7 @@ Refer to the [documentation of markmap](https://markmap.js.org/repl) for more in
::: danger
Theoretically, using code blocks highlighted by [Prism.js](https://prismjs.com/) in markmap is also supported (see [here](https://markmap.js.org/repl)). However, markmap will import syntax highlighting styles if code blocks are used, which are conflited with this theme's highlighting styles. So you'd better not use code blocks in this plugin (before I find out an appropriate solution).
:::
::: -->


## Markdown Enhancements
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ I wrote some plugins to implement some of the features of this theme. This secti
- [plugin-chart](/docs/plugins/chart/): [Chart.js](https://www.chartjs.org) (charts)
- [plugin-mermaid](/docs/plugins/mermaid/): [Mermaid](https://mermaid-js.github.io) (diagrams)
- [plugin-roughviz](/docs/plugins/roughviz/): [roughViz.js](https://github.com/jwilber/roughViz) (sketchy/hand-drawn styled charts)
- [plugin-markmap](/docs/plugins/markmap/): [markmap](https://github.com/gera2ld/markmap) (mind maps)
<!-- - [plugin-markmap](/docs/plugins/markmap/): [markmap](https://github.com/gera2ld/markmap) (mind maps) -->
- [plugin-katex](/docs/plugins/katex/): [KaTeX](https://katex.org/) (math rendering)
- [plugin-md-plus](/docs/plugins/md-plus/): Adding more syntax to Markdown, now supports footnote and mark
- [plugin-reading-time](/docs/plugins/reading-time/): Word count and reading time estimation
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/plugins/mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {

The token info of the code block should be `mermaid`, for example:

```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand All @@ -53,7 +53,7 @@ sequenceDiagram

::: details Code
~~~
```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand Down
6 changes: 3 additions & 3 deletions docs/posts/2020-10-29-hello-word.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ npm install -D vuepress-theme-gungnir

### Mermaid

```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand All @@ -158,7 +158,7 @@ sequenceDiagram
}
```

### markmap
<!-- ### markmap
```markmap
# Fruit
Expand All @@ -177,7 +177,7 @@ sequenceDiagram
## Not related
- $E = mc^2$
```
``` -->


## Images
Expand Down
6 changes: 3 additions & 3 deletions docs/posts/2020-10-30-hello-word-with-header-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ npm install -D vuepress-theme-gungnir

### Mermaid

```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand All @@ -159,7 +159,7 @@ sequenceDiagram
}
```

### markmap
<!-- ### markmap
```markmap
# Fruit
Expand All @@ -178,7 +178,7 @@ sequenceDiagram
## Not related
- $E = mc^2$
```
``` -->


## Images
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Gungnir 最初是一个基于 [Jekyll](https://jekyllrb.com/) 的主题,在 [H
- 文章目录
- 多种代码高亮主题,支持代码块全屏(从 WordPress 主题 [Sakura](https://github.com/mashirozx/Sakura) 搬过来的功能)
- 基于 [Katex](https://github.com/KaTeX/KaTeX) 的公式支持
- 在文章中使用图表:[Chart.js](https://www.chartjs.org)[Mermaid](https://mermaid-js.github.io)[roughViz.js](https://github.com/jwilber/roughViz)[markmap](https://github.com/gera2ld/markmap)
- 在文章中使用图表:[Chart.js](https://www.chartjs.org)[Mermaid](https://mermaid-js.github.io)[roughViz.js](https://github.com/jwilber/roughViz)
- 一些 Markdown 增强样式,目前支持:
- 脚注(基于 [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote)
- 高亮(基于 [markdown-it-mark](https://github.com/markdown-it/markdown-it-mark)
Expand Down
8 changes: 4 additions & 4 deletions docs/zh/docs/advanced/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ themeConfig: {

代码块的 token info 需要为 `mermaid`,例子:

```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand All @@ -244,7 +244,7 @@ sequenceDiagram

::: details 代码
~~~
```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand Down Expand Up @@ -332,7 +332,7 @@ roughViz.js 支持以下七种图表类型:
更详细的用法可以参考 [roughViz.js 文档](https://github.com/jwilber/roughViz)


### markmap
<!-- ### markmap
通过插件 [plugin-markmap](/zh/docs/plugins/markmap/) 来在 Markdown 中使用 [markmap](https://github.com/gera2ld/markmap),从而在文章中加入思维导图。
Expand Down Expand Up @@ -380,7 +380,7 @@ themeConfig: {
::: danger
markmap 还支持在思维导图中插入代码块([见这里](https://markmap.js.org/repl)),并使用 [Prism.js](https://prismjs.com/) 进行高亮。但如果插入代码块,markmap 就会引入代码块样式文件,这会与主题本身的代码块样式冲突。我目前还没有想出这个问题的解决方案,所以请不要在本插件中使用代码块。
:::
::: -->


## Markdown 增强样式
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/docs/plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ date: 2020-03-26
- [plugin-chart](/zh/docs/plugins/chart/)[Chart.js](https://www.chartjs.org)(图表)
- [plugin-mermaid](/zh/docs/plugins/mermaid/)[Mermaid](https://mermaid-js.github.io)(流程图等)
- [plugin-roughviz](/zh/docs/plugins/roughviz/)[roughViz.js](https://github.com/jwilber/roughViz)(手绘风格图表)
- [plugin-markmap](/zh/docs/plugins/markmap/)[markmap](https://github.com/gera2ld/markmap)(思维导图)
<!-- - [plugin-markmap](/zh/docs/plugins/markmap/):[markmap](https://github.com/gera2ld/markmap)(思维导图) -->
- [plugin-katex](/zh/docs/plugins/katex/)[KaTeX](https://katex.org/)(公式渲染)
- [plugin-md-plus](/zh/docs/plugins/md-plus/): 给 Markdown 添加更多语法和功能,目前支持脚注和高亮标记
- [plugin-reading-time](/zh/docs/plugins/reading-time/):字数统计和阅读时长估计
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/docs/plugins/mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {

代码块的 token info 需要为 `mermaid`,例子:

```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand All @@ -53,7 +53,7 @@ sequenceDiagram

::: details 代码
~~~
```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/mermaid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
The token info of the code block should be `mermaid`, for example:

~~~markdown
```mermaid
```mermaidjs
sequenceDiagram
Alice->John: Hello John, how are you?
loop Every minute
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/mermaid/lib/markdown-it-mermaid.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const mermaid = (md) => {
md.renderer.rules.fence = (tokens, idx, options, env, slf) => {
const token = tokens[idx];

if (token.info === "mermaid") {
if (token.info === "mermaidjs") {
try {
const key = `mermaid_${hash(idx)}`;
const code = token.content.trim();
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/mermaid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"author": "Renovamen <renovamenzxh@gmail.com>",
"main": "index.js",
"dependencies": {
"mermaid": "^8.10.1"
"mermaid": "^8.13.4"
}
}
2 changes: 1 addition & 1 deletion packages/theme-gungnir/README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- 文章目录
- 多种代码高亮主题,支持代码块全屏(从 WordPress 主题 [Sakura](https://github.com/mashirozx/Sakura) 搬过来的功能)
- 基于 [Katex](https://github.com/KaTeX/KaTeX) 的公式支持
- 在文章中使用图表:[Chart.js](https://www.chartjs.org)[Mermaid](https://mermaid-js.github.io)[roughViz.js](https://github.com/jwilber/roughViz)[markmap](https://github.com/gera2ld/markmap)
- 在文章中使用图表:[Chart.js](https://www.chartjs.org)[Mermaid](https://mermaid-js.github.io)[roughViz.js](https://github.com/jwilber/roughViz)
- 一些 Markdown 增强样式,目前支持:
- 脚注(基于 [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote)
- 高亮(基于 [markdown-it-mark](https://github.com/markdown-it/markdown-it-mark)
Expand Down
2 changes: 1 addition & 1 deletion packages/theme-gungnir/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ V2 is still **WIP**, see [v2](https://github.com/Renovamen/vuepress-theme-gungni
- Table of contents
- Multiple syntax highlighting themes, support full screening the code blocks (inspired by WordPress theme [Sakura](https://github.com/mashirozx/Sakura))
- Tex support ([KaTex](https://github.com/KaTeX/KaTeX))
- Draw charts and graphs in Markdown easily: [Chart.js](https://www.chartjs.org), [Mermaid](https://mermaid-js.github.io), [roughViz.js](https://github.com/jwilber/roughViz) and [markmap](https://github.com/gera2ld/markmap)
- Draw charts and graphs in Markdown easily: [Chart.js](https://www.chartjs.org), [Mermaid](https://mermaid-js.github.io) and [roughViz.js](https://github.com/jwilber/roughViz)
- Markdown enhancements:
- Footnote ([markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote))
- Mark ([markdown-it-mark](https://github.com/markdown-it/markdown-it-mark))
Expand Down
4 changes: 1 addition & 3 deletions packages/theme-gungnir/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = (options, ctx) => {
mermaid: false,
chartjs: false,
roughviz: false,
markmap: false,
mdPlus: false,
readingTime: {},
personalInfo: {},
Expand Down Expand Up @@ -161,8 +160,7 @@ module.exports = (options, ctx) => {
["@renovamen/vuepress-plugin-katex", options.katex],
["@renovamen/vuepress-plugin-mermaid", options.mermaid],
["vuepress-plugin-chart", options.chartjs],
["vuepress-plugin-roughviz", options.roughviz],
["vuepress-plugin-markmap", options.markmap]
["vuepress-plugin-roughviz", options.roughviz]
],

chainMarkdown(config) {
Expand Down
2 changes: 0 additions & 2 deletions packages/theme-gungnir/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"katex",
"chartjs",
"mermaid",
"markmap",
"roughviz"
],
"homepage": "https://vuepress-theme-gungnir.vercel.app",
Expand Down Expand Up @@ -40,7 +39,6 @@
"oh-vue-icons": "^0.4.7",
"vuepress-plugin-chart": "^0.3.0",
"vuepress-plugin-container": "^2.1.5",
"vuepress-plugin-markmap": "^0.2.0",
"vuepress-plugin-roughviz": "^0.2.0",
"vuepress-plugin-smooth-scroll": "^0.0.10"
},
Expand Down

1 comment on commit f89a7a6

@vercel
Copy link

@vercel vercel bot commented on f89a7a6 Nov 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.