You can find the complete code here.

This is the final chapter in this 3 part series on documentation for C++ libraries in the ReadTheDocs theme hosted on GitHub . The final website is here.

1. First part. Getting some warnings about missing documentation to appear in the build process. This will be done by incorporating Doxygen into CMake.

2. Second part. Getting an actually nice (ReadTheDocs) website up and running. This will be done using the Doxygen/Sphinx/Breathe pipeline. I won’t try to incorporate this step into the CMake file — it’s usually done via GitHub actions anyways.

3. [This part] Getting GitHub actions to automatically build and host our documentation for us.

Let’s finish this.

Image for post


GitHub Actions for automagically deploying your website

This final part will be about getting GitHub actions to automagically deploy your website. See the previous part to set up the Doxygen/Sphinx/Breathe pipeline first.

The resulting website will be public to the web, even if the project is private. This is a limitation of GitHub. If you would like you can use GitLab instead, which lets you host a password protected private website for documenting your private repo, which is pretty cool!

Git

If you haven’t already, initialize a git repo for your project:

git init .

A good .gitignore would be:

.vscode/
.DS_Store
build/
_build/
_static/
_templates/

With these I was able for our toy project to just

git add .
git commit -m “Initial commit”

Obviously we need a GitHub repo, so go ahead and make one. I called mine cpp_doxygen_sphinx (surprise). See the note above if you are making it a private repo.

Use the instructions on the repo website to push your initial commit to GitHub.

#programming #doxygen #cmake #c #github

C++ documentation with Doxygen/CMake/Sphinx/Breathe
8.95 GEEK