Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

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:

fromaasvgimportdiagram_to_irfromaasvg.render.svgimportrender_svgelements=diagram_to_ir(ascii_art_text, options={"scale": 10})
svg=render_svg(elements, stylesheet=default_css, options=options)

Options

OptionDescriptionDefault
--spaces NSplit text after N spaces (0 = char by char)2
--scale NPixels per character cell8
--aspect NVertical scale multiplier2
--stroke NLine stroke width1
--stretchStretch text to fit gridoff
--fillOmit width/height attributesoff
--width NViewbox width in charactersauto
--height NViewbox height in charactersauto
--arrow solid|lineArrowhead stylesolid
--backdropAdd white backdropoff
--embedEmbed source in SVGoff
--extractExtract embedded source from SVGoff
--no-textDisable text renderingoff
--gridDebug grid overlayoff
--sourceSource character overlayoff
--compatibleDisable dark mode CSSoff
--versionShow version
--helpShow help

License

Apache-2.0

About

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

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages