Skip to content

Integrate doxygen docs into Sphinx#466

Merged
evaneschneider merged 10 commits intocholla-hydro:devfrom
mabruzzo:integrate-doxygen
Feb 4, 2026
Merged

Integrate doxygen docs into Sphinx#466
evaneschneider merged 10 commits intocholla-hydro:devfrom
mabruzzo:integrate-doxygen

Conversation

@mabruzzo
Copy link
Collaborator

@mabruzzo mabruzzo commented Dec 17, 2025

This introduces a custom extension (doxybuild) to build the doxygen-docs as a part of sphinx.


Essentially the doxybuild extension adopts the following procedure:

  1. At startup:
    1. it constructs a custom configuration Doxyfile that includes the settings from docs/doxygen/Doxyfile and overwrites a few settings (namely the destination where the files are written and the path to the source-code directory)
    2. it generates the doxygen docs in cached build-directory
  2. It uses a sphinx-hook to generate a stub index.rst file at the location where the index.html file generated by the doxygen docs will be stored
    • for our case, the file is generated at Reference/internal-api-ref/index.rst
    • this dummy stub file needs to be present during the build to ensure that sphinx properly generates table-of-contents links (i.e. the links provided in the sidebar) to this file.1
    • the practice of generating dummy stub files was inspired by the behavior of sphinx.ext.apidoc, an extension that is developed as part of the sphinx package2
  3. It uses a sphinx-hook that gets triggered at the very end of the build-process to copy the html files generated by doxygen into the appropriate folder (the html file generated by sphinx using the dummy-stub file is overwritten in the process).

A bunch of logic is also generated to properly cache the doxygen build. In other words, iteratively rebuilding the docs won't retrigger doxygen every single time (if we don't care about this, we can cull the behavior)

Footnotes

  1. The only real alternative was to put a dummy url-link in the table-of-contents and then replace that absolute link in all html files at the end of the build

  2. sphinx.ext.apidoc is used to autogenerate docs for python modules

@mabruzzo mabruzzo changed the base branch from main to dev December 17, 2025 16:01
@mabruzzo mabruzzo marked this pull request as ready for review January 13, 2026 15:55
@evaneschneider evaneschneider merged commit 404f287 into cholla-hydro:dev Feb 4, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants