Skip to main content

Kroki integration into sphinx

Project description

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

  • :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).
  • :type: The type of the diagram (blockdiag, bpmn, bytefield, seqdiag, actdiag, nwdiag, packetdiag, rackdiag, c4plantuml, ditaa, erd, excalidraw, graphviz, mermaid, nomnoml, plantuml, 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
*.er erd
*.gv graphviz
*.iuml plantuml
*.pu plantuml
*.puml plantuml
*.uxf umlet
*.vg vega
*.vgl vegalite
*.vl vegalite
*.wsd plantuml

Configuration

  • kroki_url (default https://kroki.io).
  • kroki_output_format (default svg).
  • kroki_inline_svg (dafault False).

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

sphinxcontrib-kroki-1.2.1.tar.gz (7.5 kB view details)

Uploaded Source

File details

Details for the file sphinxcontrib-kroki-1.2.1.tar.gz.

File metadata

  • Download URL: sphinxcontrib-kroki-1.2.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

File hashes

Hashes for sphinxcontrib-kroki-1.2.1.tar.gz
Algorithm Hash digest
SHA256 9e5a126d6a66e102374dc6a45f883021e2fec3eff9ee6d91a16a0714515bacf7
MD5 7f3d10475a05e5c69a1a9b924aa14c5c
BLAKE2b-256 7b0f4716c1458df16f34c62a8f1f6b04afeca5c8dc3d48871349fa46d7873f51

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