Skip to main content

selkie/
lib.rs

1//! selkie - A Rust port of mermaid.js
2//!
3//! This library provides parsing, layout, and rendering for mermaid diagram syntax.
4//! It supports multiple diagram types including flowcharts, sequence diagrams,
5//! pie charts, and more.
6
7pub mod common;
8pub mod config;
9pub mod diagrams;
10pub mod error;
11#[cfg(feature = "eval")]
12pub mod eval;
13pub mod layout;
14pub mod render;
15
16#[cfg(feature = "kitty")]
17pub mod kitty;
18#[cfg(feature = "wasm")]
19pub mod wasm;
20
21pub use config::Config;
22pub use error::{MermaidError, Result};
23pub use render::{
24    render, render_ascii, render_ascii_with_config, render_text, render_text_ascii,
25    render_text_ascii_with_config, render_with_config, RenderConfig, Theme,
26};
27
28/// Parse a mermaid diagram and return a diagram representation
29pub fn parse(input: &str) -> Result<diagrams::Diagram> {
30    let diagram_type = diagrams::detect_type(input)?;
31    diagrams::parse(diagram_type, input)
32}