The OpenAssetIO docs are currently built with Doxygen - chosen as it is the simplest solution for a mixed Python and C++ project.
They make use of doxypy to better document Python code with docstrings containing Doxygen commands. The main limitation right now is the duplication of the namespace for hoisted Python classes.
The simplest way to build the documentation is via Docker using the container published to the GitHub Container Registry:
docker run -v `pwd`/../:/src ghcr.io/OpenAssetIO/openassetio-doc-build bash -c 'make -C /src/doc html'
If you have GNU Make installed on your system, the included Makefile
simplifies this to make.
The documentation will be built in the container, but stored (along with
the required additional tooling) in your local checkout - see
html/index.html.
Note: If you have issues pulling the container from GitHub, then you can build the image locally using
make docker-image. This should then be used for subsequentmakeinvocations.
If Docker is not available, you can build the documentation locally, but
there are a number of dependencies that must first be installed, and
available on $PATH:
- GNU Make
- Doxygen 1.8.11 (exact version, see this issue)
- npm
Once doxygen and npm are available on $PATH, the included
Makefile will build the docs bundle, simply run:
make html
The Makefile takes care of installing the other pre-requisite tooling
such as sass and doxypy.py for you.
Regardless of which mechanism you use, the resulting docs bundle will be
created in a html folder in this directory. You can view the main
index page via html/index.html.
Public facing documentation is served via GitHub Pages from the docs
branch of OpenAssetIO/OpenAssetIO.
This is automatically deployed whenever the main branch of the repository
is pushed via GitHub Actions (see workflows/docs.yml).
Should GitHub Actions be unavailable, the deployment can be updated manually, using the standard Pull Request process.
Specifically,
- Check out the latest
mainbranch. - Generate the documentation (see above), resulting in a
htmldirectory. - Check out the latest
docsbranch. - Replace the
docsdirectory in thedocsbranch checkout with the generatedhtmldirectory (i.e. renamed todocs). - Commit and push the updated
docsbranch to your fork of the repository, placing the (short) commit hash that the documentation was generated from in the commit message. - Create a Pull Request against the
docsbranch in the main repository.
For convenience, much of this can be automated using the deploy
target of the included Makefile, i.e.
make deploywhich will commit a previously generated html directory to a docs
directory in the docs branch, then push that branch to origin.
The process to update the GitHub Container Registry is currently a manual one. It requires the following:
- Docker installed locally.
- A GitHub Personal access token
with
wite:packagespermissions.
When running the make commands that work with the container registry,
you need to set a few environment variables:
GITHUB_PATA GitHub token with the correct permissions (see above).GITHUB_USERNAMEThe GitHub username that the token belongs to.GITHUB_ORG[optional] The lowercase version of the GitHub Organization that you wish to publish to container to. If not set, this defaults toopenassetio.
Before publishing:
- Make your required changes.
- Check the docs build correctly.
- Update
doc/RELEASE_NOTES.md. - Update
CONTAINER_VERSIONin theMakefileaccording to SemVer. - Create a PR, get it reviewed and merged.
First rebuild/tag the image with the new version, and double check the docs build:
make docker-image
makeThen publish the container:
GITHUB_PAT=<token> GITHUB_USER=<username> make publish-dockerThis will publish the versioned tag, and update :latest to point
to this image.
Note: The first time the image is published to any particular organisation, it will be created
private. You can change the visibility through the GitHub web page for the package.
Running make clean will remove any generated docs or automatically
installed tooling.
Once the repository is stable, we will need to publish to a release version subdirectory in the repository, so that documentation remains available for older stable versions. This will necessitate changes to the landing page to perform the appropriate redirect to the latest documentation (and ideally offer a dropdown to switch versions).