https://github.com/sphinx-contrib/kroki
Embed PlantUML, DOT, etc. diagrams in your documentation using Kroki.
https://github.com/sphinx-contrib/kroki
diagram dot erd graphviz kroki plantuml sphinx-doc sphinx-extension svgbob umlet
Last synced: 5 months ago
JSON representation
Embed PlantUML, DOT, etc. diagrams in your documentation using Kroki.
- Host: GitHub
- URL: https://github.com/sphinx-contrib/kroki
- Owner: sphinx-contrib
- License: mit
- Created: 2020-08-21T09:30:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-30T15:48:19.000Z (11 months ago)
- Last Synced: 2024-09-20T14:37:44.117Z (7 months ago)
- Topics: diagram, dot, erd, graphviz, kroki, plantuml, sphinx-doc, sphinx-extension, svgbob, umlet
- Language: Python
- Homepage:
- Size: 44.9 KB
- Stars: 36
- Watchers: 3
- Forks: 13
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
sphinxcontrib-kroki
===================Embed PlantUML, DOT, etc. diagrams in your Sphinx-based documentation using
[kroki](https://kroki.io/).Instalation
-----------Install this package via pip:
```shell script
pip install sphinxcontrib-kroki
```and enable in project configuration (`conf.py`):
```python
extensions = [
'sphinxcontrib.kroki',
]
```Usage
-----Inline diagram, show as svg:
```rest
.. kroki::
:caption: Diagram@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication ResponseAlice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
```Load a diagram from a file and show as png:
```rest
.. 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](https://docs.kroki.io/kroki/setup/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 | plantumlConfiguration
-------------- `kroki_url` (default https://kroki.io).
- `kroki_output_format` (default svg).
- `kroki_inline_svg` (dafault False).Alternatives
------------- https://github.com/sphinx-contrib/plantuml
- https://github.com/sphinx-contrib/gravizo
- https://github.com/j-martin/sphinx-diagrams