Sphinx blockdiag extension
raw JSON → 3.0.0 verified Fri May 01 auth: no python
A Sphinx extension that integrates blockdiag, seqdiag, actdiag, and nwdiag diagram generation into documentation. Current version 3.0.0; supports Python >=3.7. Release cadence is irregular.
pip install sphinxcontrib-blockdiag Common errors
error WARNING: blockdiag command cannot run ↓
cause blockdiag executable not found in PATH or not installed.
fix
Install blockdiag: pip install blockdiag
error No module named 'blockdiag' ↓
cause Required diagram backend not installed.
fix
Install the corresponding package: pip install blockdiag seqdiag actdiag nwdiag
error TypeError: setup() takes 1 positional argument but 2 were given ↓
cause Using an outdated extension registration pattern.
fix
Ensure the extension is listed as a string in extensions list (e.g., 'sphinxcontrib.blockdiag').
Warnings
breaking Version 3.0.0 removed support for Python <3.7. Upgrade your Python environment. ↓
fix Use Python 3.7+ or pin to sphinxcontrib-blockdiag==2.2.1.
gotcha The extension requires the blockdiag package to be installed separately; it is not a dependency. ↓
fix Install blockdiag: pip install blockdiag
gotcha Output format (PNG, SVG) may need explicit configuration via blockdiag_antialias or blockdiag_compiledir settings. ↓
fix Add to conf.py: blockdiag_antialias = True
Imports
- setup wrong
from sphinxcontrib import blockdiagcorrectfrom sphinxcontrib.blockdiag import setup
Quickstart
# conf.py
extensions = [
'sphinxcontrib.blockdiag',
]
# Example RST usage:
# .. blockdiag::
#
# blockdiag {
# A -> B -> C;
# }