Skip to main content

No project description provided

Project description

Note: Forked to fix errors with latest version of Python-Markdown and migrate to using Poetry.

Markdown Inline Graphviz (for Python 3)

This is just a continuation of the great job of Steffen Prince in sprin/markdown-inline-graphviz, in order to get it work with pip3. If you use python 2, please use the original extension instead.

A Python Markdown extension that replaces inline Graphviz definitions with inline SVGs or PNGs!

Why render the graphs inline? No configuration! Works with any Python-Markdown-based static site generator, suche originas MkDocs, Pelican, and Nikola out of the box without configuring an output directory.

Installation

$ pip3 install markdown_inline_graphviz_extension --user

Usage

Activate the markdown_inline_graphviz extension. For example, with Mkdocs, you add a stanza to mkdocs.yml:

markdown_extensions:
  - markdown_inline_graphviz

To use it in your Markdown doc, with SVG output:

```graphviz dot attack_plan.svg
digraph G {
    rankdir=LR
    Earth [peripheries=2]
    Mars
    Earth -> Mars
}
```

or with PNG:

```graphviz dot attack_plan.png
digraph G {
    rankdir=LR
    Earth [peripheries=2]
    Mars
    Earth -> Mars
}
```

Alternatively you can still using {% legacy notation but its not recommended.

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

Supported graphviz commands: dot, neato, fdp, sfdp, twopi, circo.

Credits

Inspired by jawher/markdown-dot, which renders the dot graph to a file instead of inline.

Forked from sprin/markdown-inline-graphviz

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page