rspress-plugin-mermaid 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -4
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
Rspress plugin to render mermaid diagrams in markdown files.
|
|
5
|
+
Rspress plugin to render [Mermaid](https://mermaid.js.org/#/) diagrams in markdown files.
|
|
6
6
|
|
|
7
7
|
Write mermaid as code blocks in markdown files and they will be rendered as SVGs:
|
|
8
8
|
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# rspress-plugin-mermaid 
|
|
2
2
|
|
|
3
|
-
为 Rspress 支持基于 [Mermaid](
|
|
3
|
+
为 Rspress 支持基于 [Mermaid](https://mermaid.js.org/#/) 的流程图、时序图等图表。
|
|
4
4
|
|
|
5
5
|
编写 Mermaid 图表时,只需使用 `mermaid` 代码块,插件会自动将其转换为 SVG。
|
|
6
6
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import {
|
|
2
|
+
import { RemarkCodeBlockToGlobalComponentPluginFactory, } from 'rspress-plugin-devkit';
|
|
3
3
|
export default function rspressPluginMermaid(options = {}) {
|
|
4
4
|
const { mermaidConfig = {} } = options;
|
|
5
5
|
const remarkMermaid = new RemarkCodeBlockToGlobalComponentPluginFactory({
|
|
@@ -21,9 +21,7 @@ export default function rspressPluginMermaid(options = {}) {
|
|
|
21
21
|
});
|
|
22
22
|
return {
|
|
23
23
|
name: 'rspress-plugin-mermaid',
|
|
24
|
-
config
|
|
25
|
-
return new PresetConfigMutator(config).disableMdxRs().toConfig();
|
|
26
|
-
},
|
|
24
|
+
// config not needed for Rspress V2
|
|
27
25
|
markdown: {
|
|
28
26
|
remarkPlugins: [remarkMermaid.remarkPlugin],
|
|
29
27
|
globalComponents: remarkMermaid.mdxComponents,
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rspress-plugin-mermaid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Rspress plugin to render mermaid diagrams",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"files": [
|
|
6
7
|
"dist",
|
|
7
8
|
"components"
|
|
@@ -27,9 +28,8 @@
|
|
|
27
28
|
"access": "public"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"@rspress/shared": "^1.17.1",
|
|
31
31
|
"mermaid": "^10.9.0",
|
|
32
|
-
"rspress-plugin-devkit": "^0.
|
|
32
|
+
"rspress-plugin-devkit": "^1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^20.12.5",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"typescript": "^5.4.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"rspress": "
|
|
40
|
+
"@rspress/core": "^2.0.0-rc.4 || ^2.0.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "tsc --declarationMap false",
|