@pathmx/mermaid 0.5.0 → 0.5.1

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.
Files changed (2) hide show
  1. package/README.md +27 -12
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,23 +1,38 @@
1
- # @pathmx/mermaid
1
+ # `@pathmx/mermaid`
2
2
 
3
- Opt-in Mermaid diagram rendering for PathMX. The base package accepts any
4
- renderer; the `beautiful` subpath supplies the pinned Beautiful Mermaid
5
- adapter and loads it only when a Mermaid fence is compiled.
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
- import { BeautifulMermaidPlugin } from "@pathmx/mermaid/beautiful"
9
- import { PathMX } from "@pathmx/core/bun"
10
- import { defaultPlugins } from "@pathmx/core/plugins"
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
- const app = await PathMX({
13
- plugins: [BeautifulMermaidPlugin, ...defaultPlugins],
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 a custom renderer through the base entrypoint:
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
- const plugin = () => MermaidPlugin(async (code) => renderDiagram(code))
37
+ export default () => MermaidPlugin(async (code) => renderDiagram(code))
23
38
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pathmx/mermaid",
3
3
  "description": "Mermaid diagram plugins and renderers for PathMX.",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {
7
7
  "type": "git",