zombie-mermaid 1.1.3

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 (252) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -0
  3. package/dist/cli.js +11194 -0
  4. package/dist/index.cjs +11060 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.d.cts +344 -0
  7. package/dist/index.d.ts +344 -0
  8. package/dist/index.js +11014 -0
  9. package/dist/index.js.map +1 -0
  10. package/package.json +104 -0
  11. package/src/__tests__/ascii-ansi.test.ts +498 -0
  12. package/src/__tests__/ascii-canvas-write.test.ts +137 -0
  13. package/src/__tests__/ascii-charset-border-junctions.test.ts +63 -0
  14. package/src/__tests__/ascii-cjk-width.test.ts +185 -0
  15. package/src/__tests__/ascii-class-diagram-compartments.test.ts +70 -0
  16. package/src/__tests__/ascii-decision-lr-box-start.test.ts +106 -0
  17. package/src/__tests__/ascii-draw-arrows-coverage.test.ts +171 -0
  18. package/src/__tests__/ascii-draw-arrows-single-point-path.test.ts +105 -0
  19. package/src/__tests__/ascii-draw-bundles.test.ts +638 -0
  20. package/src/__tests__/ascii-edge-bundling-routing.test.ts +210 -0
  21. package/src/__tests__/ascii-edge-routing-fixes.test.ts +178 -0
  22. package/src/__tests__/ascii-edge-routing-single-point-path.test.ts +103 -0
  23. package/src/__tests__/ascii-edge-styles.test.ts +149 -0
  24. package/src/__tests__/ascii-er-cardinality.test.ts +40 -0
  25. package/src/__tests__/ascii-er-label-padding.test.ts +118 -0
  26. package/src/__tests__/ascii-grid-deep-chain.test.ts +64 -0
  27. package/src/__tests__/ascii-multiline.test.ts +288 -0
  28. package/src/__tests__/ascii-pathfinder-route-edge.test.ts +184 -0
  29. package/src/__tests__/ascii-sequence-notes.test.ts +25 -0
  30. package/src/__tests__/ascii-sequence-self-arrow.test.ts +128 -0
  31. package/src/__tests__/ascii-shape-diamond.test.ts +38 -0
  32. package/src/__tests__/ascii-shape-rectangle.test.ts +258 -0
  33. package/src/__tests__/ascii-shape-rounded.test.ts +36 -0
  34. package/src/__tests__/ascii-shapes-circle.test.ts +41 -0
  35. package/src/__tests__/ascii-shapes-hexagon.test.ts +42 -0
  36. package/src/__tests__/ascii-shapes-special.test.ts +296 -0
  37. package/src/__tests__/ascii-shapes-stadium.test.ts +217 -0
  38. package/src/__tests__/ascii-shapes-state.test.ts +224 -0
  39. package/src/__tests__/ascii-subgraph-bbox.test.ts +135 -0
  40. package/src/__tests__/ascii-subgraph-label-border-clip.test.ts +89 -0
  41. package/src/__tests__/ascii-subgraph-title-padding.test.ts +77 -0
  42. package/src/__tests__/ascii-validate.test.ts +220 -0
  43. package/src/__tests__/ascii.test.ts +325 -0
  44. package/src/__tests__/browser.test.ts +34 -0
  45. package/src/__tests__/class-arrow-directions.test.ts +413 -0
  46. package/src/__tests__/class-integration.test.ts +118 -0
  47. package/src/__tests__/class-parser.test.ts +241 -0
  48. package/src/__tests__/cli-diagrams.test.ts +101 -0
  49. package/src/__tests__/cli-e2e.test.ts +213 -0
  50. package/src/__tests__/cli-entrypoint.test.ts +146 -0
  51. package/src/__tests__/cli-render.test.ts +175 -0
  52. package/src/__tests__/cli-test-helpers.ts +26 -0
  53. package/src/__tests__/cli.test.ts +204 -0
  54. package/src/__tests__/diagram-type.test.ts +28 -0
  55. package/src/__tests__/draw-lines.test.ts +93 -0
  56. package/src/__tests__/edge-approach-direction.test.ts +295 -0
  57. package/src/__tests__/er-integration.test.ts +528 -0
  58. package/src/__tests__/er-parser.test.ts +297 -0
  59. package/src/__tests__/grid-occupancy.test.ts +80 -0
  60. package/src/__tests__/integration.test.ts +595 -0
  61. package/src/__tests__/layout-disconnected.test.ts +384 -0
  62. package/src/__tests__/layout-engine.test.ts +88 -0
  63. package/src/__tests__/linkstyle.test.ts +133 -0
  64. package/src/__tests__/multiline-labels.test.ts +912 -0
  65. package/src/__tests__/nested-subgraph-direction-crossing.test.ts +304 -0
  66. package/src/__tests__/parser.test.ts +1187 -0
  67. package/src/__tests__/pathfinder.test.ts +239 -0
  68. package/src/__tests__/render-options-overrides.test.ts +250 -0
  69. package/src/__tests__/renderer.test.ts +743 -0
  70. package/src/__tests__/sequence-integration.test.ts +121 -0
  71. package/src/__tests__/sequence-layout.test.ts +861 -0
  72. package/src/__tests__/sequence-parser.test.ts +313 -0
  73. package/src/__tests__/styles.test.ts +201 -0
  74. package/src/__tests__/testdata/ascii/ampersand_lhs.txt +18 -0
  75. package/src/__tests__/testdata/ascii/ampersand_lhs_and_rhs.txt +18 -0
  76. package/src/__tests__/testdata/ascii/ampersand_rhs.txt +18 -0
  77. package/src/__tests__/testdata/ascii/ampersand_td_fanin.txt +18 -0
  78. package/src/__tests__/testdata/ascii/ampersand_td_fanout.txt +18 -0
  79. package/src/__tests__/testdata/ascii/ampersand_without_edge.txt +18 -0
  80. package/src/__tests__/testdata/ascii/back_reference_from_child.txt +10 -0
  81. package/src/__tests__/testdata/ascii/backlink_from_bottom.txt +22 -0
  82. package/src/__tests__/testdata/ascii/backlink_from_top.txt +22 -0
  83. package/src/__tests__/testdata/ascii/backlink_with_short_y_padding.txt +20 -0
  84. package/src/__tests__/testdata/ascii/cls_all_relationships.txt +17 -0
  85. package/src/__tests__/testdata/ascii/cls_annotation.txt +29 -0
  86. package/src/__tests__/testdata/ascii/cls_association.txt +14 -0
  87. package/src/__tests__/testdata/ascii/cls_basic.txt +15 -0
  88. package/src/__tests__/testdata/ascii/cls_dependency.txt +14 -0
  89. package/src/__tests__/testdata/ascii/cls_inheritance.txt +20 -0
  90. package/src/__tests__/testdata/ascii/cls_methods.txt +21 -0
  91. package/src/__tests__/testdata/ascii/comments.txt +23 -0
  92. package/src/__tests__/testdata/ascii/custom_padding.txt +10 -0
  93. package/src/__tests__/testdata/ascii/duplicate_labels.txt +19 -0
  94. package/src/__tests__/testdata/ascii/er_attributes.txt +21 -0
  95. package/src/__tests__/testdata/ascii/er_basic.txt +8 -0
  96. package/src/__tests__/testdata/ascii/er_identifying.txt +18 -0
  97. package/src/__tests__/testdata/ascii/flowchart_tb_simple.txt +29 -0
  98. package/src/__tests__/testdata/ascii/graph_bt_direction.txt +28 -0
  99. package/src/__tests__/testdata/ascii/graph_tb_direction.txt +26 -0
  100. package/src/__tests__/testdata/ascii/nested_subgraphs_with_labels.txt +36 -0
  101. package/src/__tests__/testdata/ascii/preserve_order_of_definition.txt +23 -0
  102. package/src/__tests__/testdata/ascii/self_reference.txt +10 -0
  103. package/src/__tests__/testdata/ascii/self_reference_with_edge.txt +10 -0
  104. package/src/__tests__/testdata/ascii/seq_basic.txt +17 -0
  105. package/src/__tests__/testdata/ascii/seq_multiple_messages.txt +25 -0
  106. package/src/__tests__/testdata/ascii/seq_self_message.txt +18 -0
  107. package/src/__tests__/testdata/ascii/single_node.txt +8 -0
  108. package/src/__tests__/testdata/ascii/single_node_longer_name.txt +8 -0
  109. package/src/__tests__/testdata/ascii/subgraph_complex_mixed.txt +38 -0
  110. package/src/__tests__/testdata/ascii/subgraph_complex_nested.txt +49 -0
  111. package/src/__tests__/testdata/ascii/subgraph_direction_override.txt +37 -0
  112. package/src/__tests__/testdata/ascii/subgraph_empty.txt +10 -0
  113. package/src/__tests__/testdata/ascii/subgraph_mixed_nodes.txt +20 -0
  114. package/src/__tests__/testdata/ascii/subgraph_mixed_nodes_td.txt +48 -0
  115. package/src/__tests__/testdata/ascii/subgraph_multiple_edges.txt +32 -0
  116. package/src/__tests__/testdata/ascii/subgraph_multiple_nodes.txt +16 -0
  117. package/src/__tests__/testdata/ascii/subgraph_nested.txt +24 -0
  118. package/src/__tests__/testdata/ascii/subgraph_nested_with_external.txt +30 -0
  119. package/src/__tests__/testdata/ascii/subgraph_node_outside_lr.txt +17 -0
  120. package/src/__tests__/testdata/ascii/subgraph_single_node.txt +16 -0
  121. package/src/__tests__/testdata/ascii/subgraph_td_direction.txt +26 -0
  122. package/src/__tests__/testdata/ascii/subgraph_td_multiple.txt +44 -0
  123. package/src/__tests__/testdata/ascii/subgraph_td_multiple_paddingy.txt +42 -0
  124. package/src/__tests__/testdata/ascii/subgraph_three_levels_nested.txt +32 -0
  125. package/src/__tests__/testdata/ascii/subgraph_three_separate.txt +24 -0
  126. package/src/__tests__/testdata/ascii/subgraph_two_separate.txt +20 -0
  127. package/src/__tests__/testdata/ascii/subgraph_with_labels.txt +20 -0
  128. package/src/__tests__/testdata/ascii/three_nodes.txt +9 -0
  129. package/src/__tests__/testdata/ascii/three_nodes_single_line.txt +8 -0
  130. package/src/__tests__/testdata/ascii/two_layer_single_graph.txt +19 -0
  131. package/src/__tests__/testdata/ascii/two_layer_single_graph_longer_names.txt +19 -0
  132. package/src/__tests__/testdata/ascii/two_nodes_linked.txt +8 -0
  133. package/src/__tests__/testdata/ascii/two_nodes_longer_names.txt +8 -0
  134. package/src/__tests__/testdata/ascii/two_root_nodes.txt +19 -0
  135. package/src/__tests__/testdata/ascii/two_root_nodes_longer_names.txt +19 -0
  136. package/src/__tests__/testdata/ascii/two_single_root_nodes.txt +19 -0
  137. package/src/__tests__/testdata/unicode/ampersand_lhs.txt +18 -0
  138. package/src/__tests__/testdata/unicode/ampersand_lhs_and_rhs.txt +18 -0
  139. package/src/__tests__/testdata/unicode/ampersand_rhs.txt +18 -0
  140. package/src/__tests__/testdata/unicode/ampersand_without_edge.txt +18 -0
  141. package/src/__tests__/testdata/unicode/back_reference_from_child.txt +10 -0
  142. package/src/__tests__/testdata/unicode/backlink_from_bottom.txt +22 -0
  143. package/src/__tests__/testdata/unicode/backlink_from_top.txt +22 -0
  144. package/src/__tests__/testdata/unicode/cls_all_relationships.txt +17 -0
  145. package/src/__tests__/testdata/unicode/cls_annotation.txt +29 -0
  146. package/src/__tests__/testdata/unicode/cls_association.txt +14 -0
  147. package/src/__tests__/testdata/unicode/cls_basic.txt +15 -0
  148. package/src/__tests__/testdata/unicode/cls_dependency.txt +14 -0
  149. package/src/__tests__/testdata/unicode/cls_inheritance.txt +20 -0
  150. package/src/__tests__/testdata/unicode/cls_methods.txt +21 -0
  151. package/src/__tests__/testdata/unicode/comments.txt +23 -0
  152. package/src/__tests__/testdata/unicode/duplicate_labels.txt +19 -0
  153. package/src/__tests__/testdata/unicode/er_attributes.txt +21 -0
  154. package/src/__tests__/testdata/unicode/er_basic.txt +8 -0
  155. package/src/__tests__/testdata/unicode/er_identifying.txt +18 -0
  156. package/src/__tests__/testdata/unicode/graph_bt_direction.txt +28 -0
  157. package/src/__tests__/testdata/unicode/preserve_order_of_definition.txt +23 -0
  158. package/src/__tests__/testdata/unicode/self_reference.txt +10 -0
  159. package/src/__tests__/testdata/unicode/self_reference_with_edge.txt +10 -0
  160. package/src/__tests__/testdata/unicode/seq_basic.txt +17 -0
  161. package/src/__tests__/testdata/unicode/seq_multiple_messages.txt +25 -0
  162. package/src/__tests__/testdata/unicode/seq_self_message.txt +18 -0
  163. package/src/__tests__/testdata/unicode/single_node.txt +8 -0
  164. package/src/__tests__/testdata/unicode/single_node_longer_name.txt +8 -0
  165. package/src/__tests__/testdata/unicode/three_nodes.txt +9 -0
  166. package/src/__tests__/testdata/unicode/three_nodes_single_line.txt +8 -0
  167. package/src/__tests__/testdata/unicode/two_layer_single_graph.txt +19 -0
  168. package/src/__tests__/testdata/unicode/two_layer_single_graph_longer_names.txt +19 -0
  169. package/src/__tests__/testdata/unicode/two_nodes_linked.txt +8 -0
  170. package/src/__tests__/testdata/unicode/two_nodes_longer_names.txt +8 -0
  171. package/src/__tests__/testdata/unicode/two_root_nodes.txt +19 -0
  172. package/src/__tests__/testdata/unicode/two_root_nodes_longer_names.txt +19 -0
  173. package/src/__tests__/testdata/unicode/two_single_root_nodes.txt +19 -0
  174. package/src/__tests__/text-metrics.test.ts +298 -0
  175. package/src/__tests__/theme.test.ts +108 -0
  176. package/src/__tests__/xychart-ascii.test.ts +327 -0
  177. package/src/__tests__/xychart-colors.test.ts +148 -0
  178. package/src/__tests__/xychart-integration.test.ts +137 -0
  179. package/src/__tests__/xychart-layout.test.ts +167 -0
  180. package/src/ascii/ansi.ts +500 -0
  181. package/src/ascii/canvas.ts +633 -0
  182. package/src/ascii/class-diagram.ts +765 -0
  183. package/src/ascii/converter.ts +393 -0
  184. package/src/ascii/display-width.ts +65 -0
  185. package/src/ascii/draw-arrows.ts +468 -0
  186. package/src/ascii/draw-boxes.ts +231 -0
  187. package/src/ascii/draw-bundles.ts +488 -0
  188. package/src/ascii/draw-lines.ts +165 -0
  189. package/src/ascii/draw-subgraphs.ts +93 -0
  190. package/src/ascii/draw.ts +303 -0
  191. package/src/ascii/edge-bundling.ts +343 -0
  192. package/src/ascii/edge-routing.ts +431 -0
  193. package/src/ascii/er-diagram.ts +565 -0
  194. package/src/ascii/grid-occupancy.ts +136 -0
  195. package/src/ascii/grid.ts +894 -0
  196. package/src/ascii/index.ts +166 -0
  197. package/src/ascii/multiline-utils.ts +82 -0
  198. package/src/ascii/pathfinder.ts +446 -0
  199. package/src/ascii/sequence.ts +578 -0
  200. package/src/ascii/shapes/circle.ts +31 -0
  201. package/src/ascii/shapes/corners.ts +130 -0
  202. package/src/ascii/shapes/diamond.ts +31 -0
  203. package/src/ascii/shapes/hexagon.ts +31 -0
  204. package/src/ascii/shapes/index.ts +119 -0
  205. package/src/ascii/shapes/rectangle.ts +199 -0
  206. package/src/ascii/shapes/rounded.ts +31 -0
  207. package/src/ascii/shapes/special.ts +310 -0
  208. package/src/ascii/shapes/stadium.ts +122 -0
  209. package/src/ascii/shapes/state.ts +204 -0
  210. package/src/ascii/shapes/types.ts +78 -0
  211. package/src/ascii/types.ts +373 -0
  212. package/src/ascii/validate.ts +189 -0
  213. package/src/ascii/xychart.ts +1060 -0
  214. package/src/browser.ts +36 -0
  215. package/src/class/layout.ts +274 -0
  216. package/src/class/parser.ts +347 -0
  217. package/src/class/renderer.ts +449 -0
  218. package/src/class/types.ts +121 -0
  219. package/src/cli/parse-args.ts +121 -0
  220. package/src/cli/render.ts +101 -0
  221. package/src/cli.ts +82 -0
  222. package/src/diagram-type.ts +32 -0
  223. package/src/elk-instance.ts +159 -0
  224. package/src/er/layout.ts +229 -0
  225. package/src/er/parser.ts +253 -0
  226. package/src/er/renderer.ts +474 -0
  227. package/src/er/types.ts +99 -0
  228. package/src/index.ts +174 -0
  229. package/src/layout-engine/constants.ts +19 -0
  230. package/src/layout-engine/edge-bundling.ts +287 -0
  231. package/src/layout-engine/from-elk.ts +616 -0
  232. package/src/layout-engine/layer-alignment.ts +170 -0
  233. package/src/layout-engine/to-elk.ts +645 -0
  234. package/src/layout-engine.ts +70 -0
  235. package/src/layout.ts +8 -0
  236. package/src/multiline-utils.ts +246 -0
  237. package/src/parser.ts +833 -0
  238. package/src/renderer.ts +810 -0
  239. package/src/sequence/layout.ts +561 -0
  240. package/src/sequence/parser.ts +283 -0
  241. package/src/sequence/renderer.ts +410 -0
  242. package/src/sequence/types.ts +146 -0
  243. package/src/shape-clipping.ts +197 -0
  244. package/src/styles.ts +118 -0
  245. package/src/text-metrics.ts +291 -0
  246. package/src/theme.ts +498 -0
  247. package/src/types.ts +198 -0
  248. package/src/xychart/colors.ts +177 -0
  249. package/src/xychart/layout.ts +682 -0
  250. package/src/xychart/parser.ts +125 -0
  251. package/src/xychart/renderer.ts +657 -0
  252. package/src/xychart/types.ts +150 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Craft Docs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ <div align="center">
2
+
3
+ # zombie-mermaid
4
+
5
+ **Render Mermaid diagrams as beautiful SVGs or ASCII art**
6
+
7
+ Ultra-fast, fully themeable, zero DOM dependencies. A maintained fork of [`beautiful-mermaid`](https://github.com/lukilabs/beautiful-mermaid).
8
+
9
+ ![zombie-mermaid sequence diagram example](hero.png)
10
+
11
+ [**Live demo →**](https://dfadler.github.io/zombie-mermaid/)
12
+
13
+ [![npm version](https://img.shields.io/npm/v/zombie-mermaid.svg)](https://www.npmjs.com/package/zombie-mermaid)
14
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## Why This Fork Exists
21
+
22
+ `beautiful-mermaid` is a genuinely good library — see "Why We Built This" below — but upstream development has stalled: as of this writing there are 30 open pull requests, the oldest dating back over half a year, and nothing has merged in months. `zombie-mermaid` is the same codebase, kept moving: upstream fixes get pulled in, PRs stuck in the upstream queue get a home, and releases actually ship.
23
+
24
+ It's still MIT-licensed, still built on the same foundation, and still credits the original authors below.
25
+
26
+ ## Why We Built This
27
+
28
+ Diagrams are essential for AI-assisted programming. When you're working with an AI coding assistant, being able to visualize data flows, state machines, and system architecture—directly in your terminal or chat interface—makes complex concepts instantly graspable.
29
+
30
+ [Mermaid](https://mermaid.js.org/) is the de facto standard for text-based diagrams. It's brilliant. But the default renderer has problems:
31
+
32
+ - **Aesthetics** — Might be personal preference, but wished they looked more professional
33
+ - **Complex theming** — Customizing colors requires wrestling with CSS classes
34
+ - **No terminal output** — Can't render to ASCII for CLI tools
35
+ - **Heavy dependencies** — Pulls in a lot of code for simple diagrams
36
+
37
+ We built `beautiful-mermaid` at [Craft](https://craft.do) to power diagrams in [Craft Agents](https://agents.craft.do). It's fast, beautiful, and works everywhere—from rich UIs to plain terminals.
38
+
39
+ The ASCII rendering engine is based on [mermaid-ascii](https://github.com/AlexanderGrooff/mermaid-ascii) by Alexander Grooff. We ported it from Go to TypeScript and extended it. Thank you Alexander for the excellent foundation! (And inspiration that this was possible.)
40
+
41
+ ## Features
42
+
43
+ - **6 diagram types** — Flowcharts, State, Sequence, Class, ER, and XY Charts (bar, line, combined)
44
+ - **Dual output** — SVG for rich UIs, ASCII/Unicode for terminals
45
+ - **Synchronous rendering** — No async, no flash. Works with React `useMemo()`
46
+ - **15 built-in themes** — And dead simple to add your own
47
+ - **Full Shiki compatibility** — Use any VS Code theme directly
48
+ - **Live theme switching** — CSS custom properties, no re-render needed
49
+ - **Mono mode** — Beautiful diagrams from just 2 colors
50
+ - **Zero DOM dependencies** — Pure TypeScript, works everywhere
51
+ - **Ultra-fast** — Renders 100+ diagrams in under 500ms
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ npm install zombie-mermaid
57
+ # or
58
+ bun add zombie-mermaid
59
+ # or
60
+ pnpm add zombie-mermaid
61
+ ```
62
+
63
+ ## Quick Start
64
+
65
+ ### SVG Output
66
+
67
+ ```typescript
68
+ import { renderMermaidSVG } from 'zombie-mermaid'
69
+
70
+ const svg = renderMermaidSVG(`
71
+ graph TD
72
+ A[Start] --> B{Decision}
73
+ B -->|Yes| C[Action]
74
+ B -->|No| D[End]
75
+ `)
76
+ ```
77
+
78
+ Rendering is **fully synchronous** — no `await`, no promises. The ELK.js layout engine runs synchronously via a FakeWorker bypass, so you get your SVG string instantly.
79
+
80
+ Need async? Use `renderMermaidSVGAsync()` — same output, returns a `Promise<string>`.
81
+
82
+ ### ASCII Output
83
+
84
+ ```typescript
85
+ import { renderMermaidASCII } from 'zombie-mermaid'
86
+
87
+ const ascii = renderMermaidASCII(`graph LR; A --> B --> C`)
88
+ ```
89
+
90
+ ```
91
+ ┌───┐ ┌───┐ ┌───┐
92
+ │ │ │ │ │ │
93
+ │ A │────►│ B │────►│ C │
94
+ │ │ │ │ │ │
95
+ └───┘ └───┘ └───┘
96
+ ```
97
+
98
+ Using this from React? See [React Integration](docs/react-integration.md) for a zero-flash `useMemo()` pattern.
99
+
100
+ ---
101
+
102
+ ## CLI
103
+
104
+ Installing the package also exposes a `zombie-mermaid` binary:
105
+
106
+ ```bash
107
+ zombie-mermaid render diagram.mmd --ascii # Print ASCII/Unicode to terminal
108
+ zombie-mermaid render diagram.mmd --svg -o out.svg # Render to an SVG file
109
+ cat diagram.mmd | zombie-mermaid render --ascii # Read from stdin
110
+ zombie-mermaid themes # List built-in theme names
111
+ zombie-mermaid --help # Show all options
112
+ ```
113
+
114
+ `--theme <name>` applies a built-in theme (from `themes`) to either output mode.
115
+
116
+ ---
117
+
118
+ ## Docs
119
+
120
+ - [Theming](docs/theming.md) — the two-color foundation, enriched mode, built-in themes, custom themes, Shiki compatibility
121
+ - [Supported Diagrams](docs/diagrams.md) — syntax for every diagram type, XY chart styling, and ASCII rendering options
122
+ - [React Integration](docs/react-integration.md) — zero-flash rendering with `useMemo()`
123
+ - [API Reference](docs/api-reference.md) — full function and options reference
124
+
125
+ More design write-ups and reference material live in [docs/](docs/).
126
+
127
+ ---
128
+
129
+ ## Attribution
130
+
131
+ The ASCII rendering engine is based on [mermaid-ascii](https://github.com/AlexanderGrooff/mermaid-ascii) by Alexander Grooff. We ported it from Go to TypeScript and extended it with:
132
+
133
+ - Sequence diagram support
134
+ - Class diagram support
135
+ - ER diagram support
136
+ - Unicode box-drawing characters
137
+ - Configurable spacing and padding
138
+
139
+ Thank you Alexander for the excellent foundation!
140
+
141
+ ---
142
+
143
+ ## License
144
+
145
+ MIT — see [LICENSE](LICENSE) for details.
146
+
147
+ ---
148
+
149
+ <div align="center">
150
+
151
+ Built with care by the team at [Craft](https://craft.do)
152
+
153
+ </div>