zombie-mermaid 1.7.0 → 2.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 +16 -2
- package/dist/ascii.cjs +7 -7
- package/dist/ascii.cjs.map +1 -1
- package/dist/ascii.d.cts +32 -0
- package/dist/ascii.d.ts +32 -0
- package/dist/ascii.js +2210 -1482
- package/dist/ascii.js.map +1 -1
- package/dist/cli.js +5590 -3887
- package/dist/index.cjs +55 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +180 -5
- package/dist/index.d.ts +180 -5
- package/dist/index.js +3490 -2378
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +2581 -432
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.js +2581 -432
- package/dist/mcp.js.map +1 -1
- package/package.json +9 -3
- package/src/__tests__/ascii-ansi.test.ts +15 -0
- package/src/__tests__/ascii-class-column-width-488-489.test.ts +639 -0
- package/src/__tests__/ascii-class-detour-label-routing-487.test.ts +114 -0
- package/src/__tests__/ascii-class-label-box-collision.test.ts +60 -0
- package/src/__tests__/ascii-class-label-territory-row-awareness.test.ts +57 -0
- package/src/__tests__/ascii-class-reciprocal-relationships-448.test.ts +84 -0
- package/src/__tests__/ascii-edge-bundling-rank-violation-454.test.ts +72 -0
- package/src/__tests__/ascii-edge-label-diagonal-fallback-418.test.ts +95 -0
- package/src/__tests__/ascii-er-corner-glyphs.test.ts +15 -6
- package/src/__tests__/ascii-er-relationship-overwrite.test.ts +24 -19
- package/src/__tests__/ascii-er-unrelated-stem-separation-411.test.ts +98 -0
- package/src/__tests__/ascii-hyperlinks.test.ts +361 -0
- package/src/__tests__/ascii-label-line-terminal-fallback.test.ts +168 -0
- package/src/__tests__/ascii-nested-subgraph-sibling-order-444.test.ts +105 -0
- package/src/__tests__/ascii-sequence-box-group.test.ts +159 -0
- package/src/__tests__/ascii-sequence-create-destroy.test.ts +114 -0
- package/src/__tests__/ascii-sequence-form-invariants.test.ts +7 -6
- package/src/__tests__/ascii-sequence-mermaid-parity.test.ts +21 -0
- package/src/__tests__/ascii-subgraph-direction-honored-445.test.ts +90 -0
- package/src/__tests__/box-color.test.ts +80 -0
- package/src/__tests__/class-arrow-directions.test.ts +105 -13
- package/src/__tests__/class-click-interactions.test.ts +34 -9
- package/src/__tests__/class-notes.test.ts +317 -0
- package/src/__tests__/class-parser.test.ts +87 -1
- package/src/__tests__/class-styling.test.ts +481 -0
- package/src/__tests__/cli-e2e.test.ts +62 -0
- package/src/__tests__/cli-render.test.ts +464 -3
- package/src/__tests__/cli-test-helpers.ts +5 -0
- package/src/__tests__/cli.test.ts +464 -4
- package/src/__tests__/color-utils.test.ts +186 -0
- package/src/__tests__/direction-override.test.ts +397 -0
- package/src/__tests__/interactivity-config.test.ts +34 -9
- package/src/__tests__/monospace-metrics.test.ts +74 -0
- package/src/__tests__/resolve-colors.test.ts +446 -0
- package/src/__tests__/sequence-integration.test.ts +94 -0
- package/src/__tests__/sequence-layout.test.ts +220 -0
- package/src/__tests__/sequence-parser.test.ts +287 -0
- package/src/__tests__/svg-csp-style-options.test.ts +427 -0
- package/src/__tests__/testdata/ascii/cls_all_relationships.txt +11 -9
- package/src/__tests__/testdata/ascii/subgraph_direction_override.txt +27 -17
- package/src/__tests__/testdata/unicode/cls_all_relationships.txt +11 -9
- package/src/__tests__/text-metrics.test.ts +211 -57
- package/src/__tests__/xychart-ascii.test.ts +49 -0
- package/src/ascii/ansi.ts +24 -37
- package/src/ascii/canvas.ts +31 -6
- package/src/ascii/class-diagram.ts +914 -84
- package/src/ascii/converter.ts +37 -4
- package/src/ascii/coords.ts +7 -3
- package/src/ascii/draw-boxes.ts +5 -5
- package/src/ascii/draw-subgraphs.ts +18 -3
- package/src/ascii/draw.ts +16 -2
- package/src/ascii/edge-bundling.ts +56 -0
- package/src/ascii/edge-routing.ts +87 -23
- package/src/ascii/er-diagram.ts +257 -27
- package/src/ascii/grid-occupancy.ts +1 -1
- package/src/ascii/grid.ts +87 -4
- package/src/ascii/hyperlinks.ts +248 -0
- package/src/ascii/index.ts +51 -3
- package/src/ascii/pathfinder.ts +4 -2
- package/src/ascii/sequence.ts +322 -29
- package/src/ascii/xychart.ts +36 -12
- package/src/class/layout.ts +114 -11
- package/src/class/parser.ts +215 -56
- package/src/class/renderer.ts +149 -29
- package/src/class/types.ts +42 -2
- package/src/cli/html-viewer-client-source.ts +13 -0
- package/src/cli/html-viewer-client.js +292 -0
- package/src/cli/html-viewer.ts +174 -0
- package/src/cli/parse-args.ts +220 -8
- package/src/cli/render.ts +203 -19
- package/src/cli.ts +40 -8
- package/src/color-utils.ts +205 -0
- package/src/direction-override.ts +44 -0
- package/src/er/renderer.ts +8 -1
- package/src/index.ts +90 -15
- package/src/layout-engine/from-elk.ts +1 -43
- package/src/layout-engine/to-elk.ts +33 -6
- package/src/parser.ts +11 -57
- package/src/renderer.ts +32 -35
- package/src/resolve-colors.ts +339 -0
- package/src/sequence/box-color.ts +85 -0
- package/src/sequence/layout.ts +170 -35
- package/src/sequence/parser.ts +200 -8
- package/src/sequence/renderer.ts +84 -2
- package/src/sequence/types.ts +80 -0
- package/src/style-directives.ts +214 -0
- package/src/text-metrics.ts +186 -3
- package/src/theme.ts +100 -53
- package/src/types.ts +123 -3
- package/src/xychart/renderer.ts +12 -3
package/README.md
CHANGED
|
@@ -129,13 +129,27 @@ Installing the package also exposes a `zombie-mermaid` binary:
|
|
|
129
129
|
|
|
130
130
|
```bash
|
|
131
131
|
zombie-mermaid render diagram.mmd --ascii # Print ASCII/Unicode to terminal
|
|
132
|
-
zombie-mermaid render diagram.mmd --svg
|
|
132
|
+
zombie-mermaid render diagram.mmd --svg # Render to diagram.svg (name from the input)
|
|
133
|
+
zombie-mermaid render diagram.mmd --svg -o out.svg # Render to a named SVG file
|
|
134
|
+
zombie-mermaid render diagram.mmd --svg -o out.svg --resolve-colors # …with concrete colors, for resvg/Inkscape/etc.
|
|
135
|
+
zombie-mermaid render diagram.mmd -o out.svg # Same — the format is inferred from .svg
|
|
136
|
+
zombie-mermaid render diagram.mmd --svg -o - | pbcopy # Write the SVG to stdout
|
|
137
|
+
zombie-mermaid render diagram.mmd --ascii -o out.txt # Write the ASCII rendering to a file
|
|
138
|
+
zombie-mermaid render diagram.mmd --html # Self-contained pan/zoom HTML viewer
|
|
133
139
|
cat diagram.mmd | zombie-mermaid render --ascii # Read from stdin
|
|
134
140
|
zombie-mermaid themes # List built-in theme names
|
|
135
141
|
zombie-mermaid --help # Show all options
|
|
136
142
|
```
|
|
137
143
|
|
|
138
|
-
`--theme <name>` applies a built-in theme (from `themes`) to either output mode.
|
|
144
|
+
`--theme <name>` applies a built-in theme (from `themes`) to either output mode. `--resolve-colors` replaces the CSS `var()`/`color-mix()` theming in SVG output with computed colors so rasterizers that don't evaluate CSS (resvg, librsvg, Inkscape) render the theme instead of black — see [docs/theming.md](docs/theming.md#resolved-colors-for-rasterizers).
|
|
145
|
+
`--direction <dir>` (`TD`, `TB`, `BT`, `LR`, or `RL`) overrides the diagram's layout direction in either output mode without editing the source — flowchart, state, and ER diagrams; a nested subgraph's own `direction` still applies on top of it. The same override is available to library callers as the `direction` render option (see [API Reference](docs/api-reference.md)).
|
|
146
|
+
`--hyperlinks` (with `--ascii`) turns `click` hrefs into OSC 8 terminal
|
|
147
|
+
hyperlinks — off by default, since terminal and pager support varies (see
|
|
148
|
+
[ASCII terminal hyperlinks](docs/diagrams.md#ascii-terminal-hyperlinks)).
|
|
149
|
+
|
|
150
|
+
**Output rules.** `-o` is the destination for the run's _file_ output — SVG or HTML when `--svg`/`--html` is given, otherwise the ASCII rendering — and `-o -` sends it to stdout instead. A recognised extension (`.svg`, `.html`/`.htm`, `.txt`) picks the format on its own, so the flag can be dropped; an extension that contradicts an explicit flag (`--svg -o out.txt`) is an error, while unrecognised ones are simply used as given. `--svg`/`--html` with no `-o` writes `<input stem>.svg`/`.html` beside the input (stdin input has no name to derive from, so it must pass `-o`). `--svg` and `--html` cannot both be set — run the command twice for both. ASCII always prints to the terminal when SVG/HTML is also requested (`--ascii --svg -o out.svg`), and never carries ANSI colour codes when written to a file. **An existing output file is never overwritten unless you pass `--force`/`-f`.**
|
|
151
|
+
|
|
152
|
+
**`--html`** wraps the rendered SVG in a self-contained pan/zoom viewer — one file, no server, no network — with drag/scroll pan, ctrl/cmd+scroll and pinch to zoom, fit/1:1 buttons, a light/dark toggle that follows `prefers-color-scheme`, and keyboard controls. It opens straight from disk and survives being emailed as a single attachment. This is the one place in the project that ships client-side JavaScript, and deliberately so — see [`docs/decisions/no-script-interactivity.md`](docs/decisions/no-script-interactivity.md): the library's own SVG output stays permanently script-free, and this viewer is a separate CLI artifact wrapping that output, never part of it.
|
|
139
153
|
|
|
140
154
|
---
|
|
141
155
|
|