#ascii-art #diagram #svg #graphics #ascii #markdeep

aasvg

Convert ASCII art diagrams to SVG with automatic light/dark mode support

1 stable release

1.0.0 Dec 27, 2025

#312 in Text processing

Download history 3/week @ 2025-12-25 106/week @ 2026-01-01 69/week @ 2026-01-08 67/week @ 2026-01-15 7/week @ 2026-01-22 1/week @ 2026-01-29

157 downloads per month
Used in aasvg-cli

BSD-2-Clause

200KB
4K SLoC

Rust 2.5K SLoC // 0.1% comments JavaScript 1.5K SLoC // 0.1% comments

aasvg-rs

Crates.io Documentation License

A Rust port of aasvg, which converts ASCII art diagrams into SVG.

example

CLI Usage

cargo install aasvg-cli

# Convert a file
aasvg input.txt -o output.svg

# Or use stdin/stdout
cat input.txt | aasvg > output.svg

Library Usage

use aasvg::render;

let diagram = r#"
    +-----+     +-----+
    |     |---->|     |
    +-----+     +-----+
"#;

let svg = render(diagram);

The output SVG automatically supports light and dark mode via CSS prefers-color-scheme.

Attribution

This project is a Rust port of Martin Thomson's aasvg, which itself uses the diagram rendering code from Morgan McGuire's Markdeep.

Related projects:

  • goat - A Go implementation that reimplements the Markdeep algorithm

License

BSD-2-Clause, matching the original aasvg license.

No runtime deps