Skip to content

gslf/rust_mermaid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Mermaid

Generate mermaid.js diagrams from Rust


:#/ GSLF


rust_mermaid logo

Add rust_mermaid

[dependencies]
rust_mermaid = "0.1.1"

How to use rust_mermaid

use rust_mermaid::create_diagram;
use rust_mermaid::save_diagram;

fn main() {
    println!("Test diagram creation:");
    let description = "graph LR;
        A--> B & C & D;
        B--> A & E;
        C--> A & E;
        D--> A & E;
        E--> B & C & D;
    ";
    let result = create_diagram(description);
    
    match result{
        Ok(_) =>  println!("It's worked!"),
        Err(error) => panic!("Ops, there is a problem! {}", error),
    }

    println!("Test diagram file creation:");
    let description = "graph LR;
        A--> B & C & D;
        B--> A & E;
        C--> A & E;
        D--> A & E;
        E--> B & C & D;
    ";
    let result = save_diagram(description, "test.jpg");
    
    match result{
        Ok(_) =>  println!("It's worked!"),
        Err(error) => panic!("Ops, there is a problem! {}", error),
    }

}


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages