@pathmx/mermaid 0.5.0 → 0.5.2
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 +27 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@pathmx/mermaid`
|
|
2
2
|
|
|
3
|
-
Opt-in Mermaid diagram rendering for PathMX.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Opt-in Mermaid diagram rendering for PathMX.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
bun run pmx plugins add mermaid
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Activate the ready-to-use Beautiful Mermaid renderer:
|
|
6
12
|
|
|
7
13
|
```ts
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
// plugins/mermaid.plugin.ts
|
|
15
|
+
export { BeautifulMermaidPlugin as default } from "@pathmx/mermaid/beautiful"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then author ordinary Mermaid code fences:
|
|
11
19
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
````md
|
|
21
|
+
```mermaid
|
|
22
|
+
flowchart LR
|
|
23
|
+
Source --> Plugin --> View
|
|
15
24
|
```
|
|
25
|
+
````
|
|
26
|
+
|
|
27
|
+
The renderer loads only when a Source contains a Mermaid fence. Diagrams use
|
|
28
|
+
the active PathMX theme and include a larger-view control.
|
|
29
|
+
|
|
30
|
+
## Custom renderer
|
|
16
31
|
|
|
17
|
-
Use
|
|
32
|
+
Use the base package when another renderer should produce the SVG:
|
|
18
33
|
|
|
19
34
|
```ts
|
|
20
35
|
import { MermaidPlugin } from "@pathmx/mermaid"
|
|
21
36
|
|
|
22
|
-
|
|
37
|
+
export default () => MermaidPlugin(async (code) => renderDiagram(code))
|
|
23
38
|
```
|