ASCIIToSVG

ASCIIToSVG is a pretty simple Go library (with an accompanying CLI tool) that parses ASCII art diagrams, attempting to convert them to an aesthetically pleasing SVG output.

Example

[a2s, format="svg"]
....
.-------------------------.
|                         |
| .---.-. .-----. .-----. |
| | .-. | +-->  | |  <--| |
| | '-' | |  <--| +-->  | |
| '---'-' '-----' '-----' |
|  ascii     2      svg   |
|                         |
'-------------------------'
....
a2s

Installation

  • Install the Go runtime

  • Run go install github.com/asciitosvg/asciitosvg@latest

Supported Image Formats

  • SVG (default)

  • TXT

Attributes

Name Default value Description

svg-type

unspecified

One of static, inline or interactive. This determines the style of SVG embedding that’s used in certain backends. The asciidoc spec describes this in more detail.

server-url

unspecified

External service to render diagram. Usage removes the need to depend on external tools to be installed locally.

server-type

unspecified

One of plantuml or kroki_io

max-get-size

1024

The maximum size of the URI path for HTTP GET requests. If the maximum size is exceeded, POST requests are used instead

Attributes

Name Default value Description

a2s

a2s

The path to the a2s executable

fontfamily

unspecified

The font family to use in the generated SVG image

noblur

unspecified

Disable drop-shadow blurring