Skip to main content

Crate ariel_rs

Crate ariel_rs 

Source
Expand description

ariel-rs — a pure-Rust Mermaid diagram renderer.

Converts Mermaid diagram source text into SVG strings without requiring a JavaScript runtime or browser.

§Quick start

let svg = ariel_rs::render("graph LR\n  A --> B", ariel_rs::theme::Theme::Default);
assert!(svg.contains("<svg"));

The two entry points are render and render_svg (an alias). Both accept any supported Mermaid diagram type and a theme::Theme variant. For a fallible variant that returns RenderError instead of an error SVG, use try_render.

Re-exports§

pub use error::ParseError;
pub use error::ParseResult;
pub use error::RenderError;

Modules§

error
Error and parse-result types for ariel-rs diagram parsing and rendering.
theme
Colour-theme types for Mermaid diagram rendering.

Structs§

RenderOptions
Per-call rendering configuration passed to render_with_options and try_render_with_options.

Enums§

DiagramType
The type of a Mermaid diagram, as detected from the source text.

Functions§

detect
Detect which DiagramType a Mermaid source string represents.
render
Render any Mermaid diagram source to an SVG string.
render_svg
Alias for render — renders any Mermaid diagram source to an SVG string.
render_with_options
Render any Mermaid diagram source to an SVG string using RenderOptions.
try_render
Render any Mermaid diagram source to an SVG string.
try_render_with_options
Render any Mermaid diagram source to an SVG string using RenderOptions.