A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Tanami/markdown-graphviz-svg below:

Tanami/markdown-graphviz-svg: Extension for python-markdown and ReText to embed Graphviz output.

Markdown Graphviz SVG (for Python 3 and ReText)

This is a rewrite/continuation of the following modules:

At some point in the development of python-markdown the original method that these modules used to embed Graphviz was broken because the way it inserted the rendered SVG was dumb (see:).

I have poorly reimplemented the original functionality with the BlockProcessors class, this is a bit finnicky with the parsing of blocks (sometimes you need to use double newlines). But it is more robust than using the Preprocessor method.

I did not implement the PNG rendering functionality because I don't use it. If you want to make significantly smaller documents you might wish to implement SVGZ with the original PNG method from python-markdown-graphviz.

Because this uses the special {% %} syntax, it should be compatible with Jinja and other platforms that recognise it as such, however this is untested.

{% dot
    digraph G {
        rankdir=LR
        Earth [peripheries=2]
        Mars
        Earth -> Mars
    }
%}

Where dot can be any of: dot, neato, fdp, sfdp, twopi, circo.

MIT License


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4