Version 0 of dia2kroki

Updated 2022-02-18 12:57:39 by DDG

NAME

dia2kroki - convert textual descriptions for various diagram tools to image URL's using the https://kroki.io/ webservice.

# dia2kroki.tcl
proc dia2kroki {text {dia graphviz} {ext svg}} {
    set b64 [string map {+ - / _ = ""}  [base64url encode [zlib compress $text]]]
    set uri https://kroki.io//$dia/$ext/$b64
}

EXAMPLE

% source dia2kroki.tcl
% puts [dia2kroki "digraph G { A -> B }"]
https://kroki.io//graphviz/svg/eJxLyUwvSizIUHBXqFZwVNC1U3BSqAUAREAFzQ

This url can be directly embedded for instance in this Wiki asn an image:

[https://kroki.io//graphviz/svg/eJxLyUwvSizIUHBXqFZwVNC1U3BSqAUAREAFzQ]

That is how it looks like:

[L1 ]

DISCUSSION

Please discuss here: