[][src]Crate pikchr

Pikchr image creation binding

This crate provides a binding for the pikchr diagramming language. Using this crate you can convert PIC-like markup into SVG diagrams trivially. If you are embedding into HTML then you can have any errors generated as HTML, otherwise errors are generated as plain text.

The main interface is the Pikchr struct, specifically its Pikchr::render function.

use pikchr::{Pikchr, PikchrFlags};

let INPUT = r#"
arrow right 200% "Markdown" "Source"
box rad 10px "Markdown" "Formatter" "(docs.rs/markdown)" fit
arrow right 200% "HTML+SVG" "Output"
arrow <-> down 70% from last box.s
box same "Pikchr" "Formatter" "(docs.rs/pikchr)" fit
"#;

let pic = Pikchr::render(INPUT, None, PikchrFlags::default()).unwrap();

println!("{}", pic);

MarkdownSourceMarkdownFormatter(docs.rs/markdown)HTML+SVGOutputPikchrFormatter(docs.rs/pikchr)

Modules

raw

Structs

Pikchr

A rendered pikchr diagram

PikchrFlags

Flags for converting pikchr source