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 poetry. Building every documentation surface requires:
- Python 3.10 or newer and poetry.
- 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.
poetry install 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
poetry install
poetry run python scripts/zensical_build.py
echo User documentation available in site/
cd api-docs
poetry run make html
echo Python API documentation available in build/html
cd cppdocs
poetry run make html
echo C++ API documentation available in html/
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:
poetry run 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 poetry run zensical serve feature is particularly helpful for live previews.