sphinx-contrib / kroki

Embed PlantUML, DOT, etc. diagrams in your documentation using Kroki.
MIT License
37 stars 13 forks source link
diagram dot erd graphviz kroki plantuml sphinx-doc sphinx-extension svgbob umlet

sphinxcontrib-kroki

Embed PlantUML, DOT, etc. diagrams in your Sphinx-based documentation using kroki.

Instalation

Install this package via pip:

pip install sphinxcontrib-kroki

and enable in project configuration (conf.py):

extensions = [
    'sphinxcontrib.kroki',
]

Usage

Inline diagram, show as svg:

.. kroki::
   :caption: Diagram

    @startuml
    Alice -> Bob: Authentication Request
    Bob --> Alice: Authentication Response

    Alice -> Bob: Another authentication Request
    Alice <-- Bob: Another authentication Response
    @enduml

Load a diagram from a file and show as png:

.. kroki:: ./path/to/graph.puml png

Options

The diagram type can be automatically derived from the file extension (as same as type). Additional supported extensions:

Extension Type
*.bob svgbob
*.c4 c4plantuml
*.c4puml c4plantuml
*.dot graphviz
*.dsl structurizr
*.er erd
*.gv graphviz
*.iuml plantuml
*.pu plantuml
*.puml plantuml
*.uxf umlet
*.vg vega
*.vgl vegalite
*.vl vegalite
*.wsd plantuml

Configuration

Alternatives