Sphinx Extension to add the drawio
directive to include draw.io diagrams.
Important: This extension is in development and not all features will work as advertised or at all.
The drawio-desktop package does not run without an x-server (e.g. when in a CI
environment), see
this issue.
The workaround is to install xvfb-run
.
python3 -m pip install sphinxcontrib-drawio
- In your sphinx config:
extensions = [
"sphinxcontrib.drawio"
]
- Add the binary to
$PATH
. For Windows addC:\Program Files\draw.io
and on Linux add/opt/draw.io/
. - (required by default, see below)
sudo apt install xvfb
These are the available options and their default values.
drawio_output_format = "png"
drawio_binary_path = "/path/to/draw.io-binary"
drawio_headless = True
.. drawio:: example.drawio
:format: png
:alt: An Example
:align: center
If any other of the draw.io
CLI tool's options are wanted, please file an issue.