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);
  • :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

  • 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.3.0.tar.gz (7.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: sphinxcontrib-kroki-1.3.0.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.3.0.tar.gz
Algorithm Hash digest
SHA256 90ce45e1f5822443772d4df8ddf031746101dc1fd5a0a831a1db7e0886c49b6a
MD5 a3c7fe6c119fdcc302167fc812d47710
BLAKE2b-256 6c45df35ca9fbe04b1dba8a54b5fb9783c6a93e8df345c18fd40c4554a8936b4

See more details on using hashes here.

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