package termaid
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Render Mermaid diagrams as Unicode box-drawing art
Install
dune-project
Dependency
Authors
Maintainers
Sources
termaid-1.0.0.tbz
sha256=29bf91de7d567e0dd0534a0ec814cf51c48c077d1d860f0d9a427f5d71ac7f65
sha512=bc288d8fd4918aacc79da66efac8fc76e8a94e6a9c01cbf886eb3c5f959383584ad30a526e8f5f55aa24f0477834019feb7e1d2e2ecea147cf4f18ce6a242ffa
doc/CHANGES.html
Changelog
1.0.0 (2026-07-18)
First release — an OCaml port of the self-contained Rust mermaid.rs terminal renderer from xai-org/grok-build (Apache-2.0; see NOTICE).
- Render five Mermaid diagram types to Unicode box-drawing art — flowchart / graph, state, class, entity-relationship, and sequence — including subgraphs, self-loops, thick/dotted edges, arrowhead variants, and diagram-specific features (choice pseudo-states, class members/annotations/generics, ER cardinalities, sequence notes/blocks/autonumber). Unrecognized or too-wide input renders as a framed fallback box.
- Public API:
Termaid.render : ?max_width:int -> string -> t option, returning plain UTF-8 lines plus a TUI-agnostic, class-tagged span model (map theclsof each run to your own colors). No terminal-framework dependency; Unicode width viauucp/uutf. - Layout engine: Sugiyama-style rank assignment, barycenter crossing reduction, coordinate relaxation, and greedy track packing, painted onto a box-drawing canvas with junction-aware glyph resolution.
- Verified byte-for-byte against the upstream renderer across 53 golden fixtures (every diagram type plus wide/tall/dense layout stress cases); 145 invariant tests faithfully port the upstream test suite. CI covers Linux and macOS on OCaml 4.14 and 5.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page