Merman
Mermaid diagrams, rendered in Rust.
Parse, lay out, and render Mermaid diagrams for documentation, editor previews, reports, and
applications. Merman runs headlessly: its native rendering path needs no browser or JavaScript
runtime. Use it as a Rust library, a CLI, or through browser and native bindings.

Try the Playground · Quick start · Ecosystem · Documentation
Actual Merman SVG exports from the Playground’s standalone JSON theme library.
Open a design above for its gallery of diagram types, sources, editable recipe, and integration examples.
Used by Zed. Zed uses Merman as its Rust Mermaid backend.
Read the merged integration.
Quick start
The examples below use 0.10.0-alpha.2. For release selection and prebuilt downloads, start
with the host installation guide.
Rust
With Rust 1.95 or later, add Merman to your Cargo.toml:
[dependencies]
merman = "=0.10.0-alpha.2"
Save this as src/main.rs:
use merman::{OperationControl, RenderOutput, RenderRequest, Renderer, SvgRequest};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let output = Renderer::new().render(RenderRequest::svg(
"flowchart LR\n Source[Mermaid source] --> Merman --> Svg[SVG string]",
OperationControl::new(),
SvgRequest::default(),
))?;
let RenderOutput::Svg(Some(svg)) = output else {
return Err("no Mermaid diagram detected".into());
};
print!("{}", svg.svg());
Ok(())
}
cargo run --quiet > diagram.svg
See the Rust embedding guide and runnable examples for configuration,
repeated rendering, and host integration.
CLI
Install from Cargo and render a first diagram:
cargo install merman-cli --version 0.10.0-alpha.2 --locked
printf 'flowchart LR\n Source --> Merman --> SVG\n' | merman-cli render - --output diagram.svg
For an existing file, run merman-cli render diagram.mmd --output diagram.svg.
The CLI guide also covers prebuilt installation, PNG/JPEG/PDF export, Markdown batches,
linting, and ASCII/Unicode output for supported families.
Ecosystem
Choose the host where your application runs. Each guide owns its installation steps and
available operations; the host guide records release availability across channels.
Beyond SVG, Merman offers typed diagram models, diagnostics, editor APIs, image/PDF export,
and terminal output. Start with the capability guide for feature selection or the
package surface guide for the complete product map.
Make it your own
Built-in presets such as Brutalist, Spotless, Cyberpunk, and Ghibli are selected by their
runtime preset IDs. The standalone explorations in the Playground theme designs
are editable JSON recipes, including the four designs shown above and coordinated light/dark
designs. Browse by diagram type and style, then copy a recipe to use it through Rust, CLI, Web, or Node.
The theme guide covers adopting and customizing recipes, family scope, and output support.
The preset gallery shows more real renders and includes design credits.
Merman follows pinned Mermaid source, with checks for parsing, layout, configuration, themes,
and SVG structure. Browse the alignment dashboard for diagram-family coverage and comparison
evidence, from Flowchart and Sequence to Class, ER, State, Gantt, Mindmap, and charts.
Text measurement, host fonts, HTML labels, and hand-drawn paths can differ from browser output.
The SVG output guide explains the output pipelines and viewer requirements. Performance
methodology, workloads, and reproducible commands live in the benchmark guide.
Documentation and contributing
The documentation index routes to maintained guides for integration, architecture, and
development. See resource policy for cancellation and bounded host workloads,
rendering security for safe embedding, and the contributor and CI guide for local checks.
Use the changelog and release and upgrade index when moving between releases.
License and attribution
Merman’s own code is available under the Apache License 2.0 or MIT License.
Distributed components retain their own licenses and notices, including EPL-2.0 ELK in default
Rust rendering features. See THIRD_PARTY_NOTICES.md for the
feature-dependent requirements.
Merman is independent of, and not affiliated with, endorsed by, or sponsored by the Mermaid
project or its maintainers.
评论