1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// The layout code walks several parallel arrays (positions, sizes,
// layers) by index on purpose — iterator zips would obscure the
// math, not clarify it.
//! flowmaid — a Mermaid-like diagram engine.
//!
//! Supported diagram types: flowcharts (`flowchart` / `graph`),
//! Entity-Relationship diagrams (`erDiagram`), UML class diagrams
//! (`classDiagram`), sequence diagrams (`sequenceDiagram`), pie
//! charts (`pie`), and state diagrams (`stateDiagram-v2`).
//!
//! Library usage:
//!
//! ```
//! let svg = flowmaid::render_svg("flowchart TD\nA[Start] --> B[Done]").unwrap();
//! assert!(svg.starts_with("<svg"));
//!
//! let er = flowmaid::render_svg("erDiagram\nusers ||--o{ posts : writes").unwrap();
//! assert!(er.contains("users"));
//!
//! let uml = flowmaid::render_svg("classDiagram\nAnimal <|-- Dog").unwrap();
//! assert!(uml.contains("Animal"));
//! ```
pub use Document;
pub use ParseError;
/// Shortcut: Mermaid-syntax text -> SVG string. Dispatches on the
/// diagram type header (flowchart/graph, erDiagram, classDiagram,
/// sequenceDiagram, pie, or stateDiagram-v2).