Building Documentation¶
CLA¶
To contribute to the Binary Ninja documentation, first sign the contribution license agreement and send it to Vector 35.
Prerequisites¶
The Python documentation tools are managed with uv. Building every documentation surface requires:
- Python 3.10 or newer and uv.
- Doxygen 1.12 or newer available on
PATHfor the C++ API reference. - A matching Binary Ninja installation whose
binaryninjaPython module can be imported. The API revision must match the installation'sapi_REVISION.txt.
uv sync --locked installs zensical, sphinx, and breathe. It does not install Doxygen or Binary Ninja.
Building¶
git clone https://github.com/Vector35/binaryninja-api/
cd binaryninja-api
uv sync --locked
uv run --locked python scripts/zensical_build.py
echo User documentation available in site/
cd api-docs
uv run --locked make html
echo Python API documentation available in build/html
cd cppdocs
uv run --locked make html
echo C++ API documentation available in html/
On Windows, use uv run --locked cmd.exe /d /c .\make.bat html in both
api-docs and api-docs/cppdocs in place of uv run --locked make html.
Use the same command with clean to remove the generated output.
scripts/zensical_build.py runs zensical build and then writes the redirect stubs described by [project.plugins.redirects.redirect_maps] in zensical.toml.
Validating¶
Every build runs zensical build --strict, which fails on links to pages or anchors that do not exist. That covers internal references only. External URLs are checked separately by scripts/check_links.py, which requests every external URL in docs/ and reports the file and line of any that fail:
uv run --locked python scripts/check_links.py
It is slow and depends on the network, so run it out of band rather than as part of a build. Sites that block automated requests are reported separately from broken links and do not affect the exit code unless --strict is passed.
Changing¶
Changing documentation for the API itself is fairly straightforward. Use doxygen style comment blocks in C++ and C, and restructured text blocks for python for the source. The user documentation is located in the docs/ folder and the API documentation is generated from the config in the api-docs folder.
Tip
When updating user documentation, the uv run --locked zensical serve feature is particularly helpful for live previews.