Turn ASCII art diagrams into SVG.
Python port of aasvg, which uses a heavily modified copy of markdeep.
pip install aasvgaasvg < diagram.txt > output.svg
aasvg --scale 10 --backdrop < diagram.txt > output.svg
echo'-->'| aasvg --embed > file.svgOr as a library:
fromaasvgimportdiagram_to_irfromaasvg.render.svgimportrender_svgelements=diagram_to_ir(ascii_art_text, options={"scale": 10})
svg=render_svg(elements, stylesheet=default_css, options=options)| Option | Description | Default |
|---|---|---|
--spaces N | Split text after N spaces (0 = char by char) | 2 |
--scale N | Pixels per character cell | 8 |
--aspect N | Vertical scale multiplier | 2 |
--stroke N | Line stroke width | 1 |
--stretch | Stretch text to fit grid | off |
--fill | Omit width/height attributes | off |
--width N | Viewbox width in characters | auto |
--height N | Viewbox height in characters | auto |
--arrow solid|line | Arrowhead style | solid |
--backdrop | Add white backdrop | off |
--embed | Embed source in SVG | off |
--extract | Extract embedded source from SVG | off |
--no-text | Disable text rendering | off |
--grid | Debug grid overlay | off |
--source | Source character overlay | off |
--compatible | Disable dark mode CSS | off |
--version | Show version | |
--help | Show help |
Apache-2.0