BADASCII
This crate provides a backend library for processing BADASCII strings. These strings represent simple block diagrams written using basic ASCII characters. Like this:
+-------------+ +-------------+
| Thing 1 | | Thing 2 |
| | | |
+--->|ins outs+------->|ins outs+----+
| | | | | |
| | | | | |
| +-------------+ +-------------+ |
| |
+----------------------------------------------+
and convert them into SVG images like this:
To use this as a library, the API is pretty simple:
use ;
// Create a text buffer from the string
let text_buffer = with_text;
// Create a render job
let job = rough;
// Render it with a white text color
let svg = render;
// Rejoice! `svg` contains a string with the SVG
Other stuff
You can use badascii in your RustDoc generated comments
using the badascii-doc crate. You can also edit badascii
diagrams using the GUI editor at badascii-gui. And
eventually at the website I plan to set up. Last but not
least, there is a mdbook preprocessor at badascii-mdbook.
Alternates
There are many. The most sophisticated might be svgbob.