Skip to main content

sphinx-kroki

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

Instalation

Install this package via pip:

pip install sphinx-kroki

and enable in project configuration (conf.py):

extensions = [
    'sphinx_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

  • :align: The horizontal alignment of the diagram (left, center or right);
  • :caption: The caption of the diagram;
  • :class: The class names (a list of class names separeted by spaces);
  • :filename: The path to the file with the diagram;
  • :format: The output format of the diagram (default svg);
  • :name: The hyperlink reference to the element;
  • :options:: The diagram options in yaml format;
  • :type: The type of the diagram (actdiag, blockdiag, bpmn, bytefield, c4plantuml, dot, ditaa, er, erd, excalidraw, graphviz, mermaid, nomnoml, nwdiag, packetdiag, pikchr, plantuml, rackdiag, structurizr, seqdiag, svgbob, umlet, vega, vegalite, wavedrom).

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

Metadata

Release files for sphinx-kroki 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-kroki 0.1.0
File Size Uploaded
sphinx_kroki-0.1.0.tar.gz 95.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-kroki 0.1.0
File Interpreter ABI Platform
sphinx_kroki-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 103.6 kB

Release files / sphinx_kroki-0.1.0.tar.gz

Download URL sphinx_kroki-0.1.0.tar.gz
Size 95.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c384caffc2d25a2a45c623b0ce306b7b8df0c9c5894c57c12fe9bdfadcb7a549
BLAKE2b-256 checksum
How to use checksums
bbeff7737c20f36dc844a45a6f0f0d992b616e7a08ba0193704b48b591556d37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / sphinx_kroki-0.1.0-py3-none-any.whl

Download URL sphinx_kroki-0.1.0-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7401864a6becd1615f71665d3ac4c340a54d75e44b40b45fd07b856e8afda179
BLAKE2b-256 checksum
How to use checksums
d419470b284ac5e6ec1c5656e70f03e6862d17c1690c91ed3d39240492ce3e49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page