figurehead 0.1.0

A Rust library to convert Mermaid.js diagram markup into ASCII diagrams
Documentation

Figurehead - Convert Mermaid.js diagrams to ASCII art

A library for parsing Mermaid.js flowchart syntax and rendering it as ASCII art.

Quick Start

use figurehead::render;

let input = "graph LR; A-->B-->C";
let ascii = render(input).unwrap();
println!("{}", ascii);

Advanced Usage

For more control, use the individual components:

use figurehead::prelude::*;

let input = "graph TD; A[Start] --> B{Decision}";

// Parse into a database
let parser = FlowchartParser::new();
let mut database = FlowchartDatabase::new();
parser.parse(input, &mut database).unwrap();

// Access the parsed data
assert_eq!(database.node_count(), 2);
assert_eq!(database.direction(), Direction::TopDown);

// Render to ASCII
let renderer = FlowchartRenderer::new();
let ascii = renderer.render(&database).unwrap();