Skip to content

fishman/python-aasvg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aasvg

Turn ASCII art diagrams into SVG.

Python port of aasvg, which uses a heavily modified copy of markdeep.

Install

pip install aasvg

Usage

aasvg < diagram.txt > output.svg
aasvg --scale 10 --backdrop < diagram.txt > output.svg
echo '-->' | aasvg --embed > file.svg

Or as a library:

from aasvg import diagram_to_ir
from aasvg.render.svg import render_svg

elements = diagram_to_ir(ascii_art_text, options={"scale": 10})
svg = render_svg(elements, stylesheet=default_css, options=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

License

Apache-2.0

About

Turn ASCII art diagrams into SVG - a pure Python port of aasvg

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors