Skip to main content

Kroki integration into sphinx

Project description

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

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

sphinx_kroki-0.1.0.tar.gz (95.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_kroki-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_kroki-0.1.0.tar.gz.

File metadata

  • Download URL: sphinx_kroki-0.1.0.tar.gz
  • Upload date:
  • Size: 95.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for sphinx_kroki-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c384caffc2d25a2a45c623b0ce306b7b8df0c9c5894c57c12fe9bdfadcb7a549
MD5 e0d19fadf348d47ba5d14348fc847ef3
BLAKE2b-256 bbeff7737c20f36dc844a45a6f0f0d992b616e7a08ba0193704b48b591556d37

See more details on using hashes here.

File details

Details for the file sphinx_kroki-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sphinx_kroki-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for sphinx_kroki-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7401864a6becd1615f71665d3ac4c340a54d75e44b40b45fd07b856e8afda179
MD5 e25a293461dd28b8e945f645d0b16726
BLAKE2b-256 d419470b284ac5e6ec1c5656e70f03e6862d17c1690c91ed3d39240492ce3e49

See more details on using hashes here.

Supported by

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