Documentation for RcppSMC.
Two types of documentation are available:
-
Good old doxygen:
- create
./build
andcmake ..
followed bymake docs
- produces html files in the directory
./build/docs_doxygen/html
- view the documentation via
./build/docs_doxygen/html/index.html
- create
-
Using Sphinx (modern look, facilitates readability, but less detailed API documentation)
- use
make html
inside./docs_sphinx
- output is stored in
./docs_sphinx/html
- view the documentation via
./docs_sphinx/html/index.html
- use
- Copy new code into
./include
or./src
git add .
,git commit
andgit push
, which triggers automatic deployment- Github actions automatically deploys the page
The directory ./.github/workflows/docs.yml
contains the config for this. The
following part is relevant to change from Sphinx-style to doxygen-style web
documentation:
...
- name: Build docs
run: cd docs_sphinx # cd build
&& make html # && cmake ..
&& cd _build/html # && make docs
&& touch .nojekyll # delete this statement if doxygen is used
...
FOLDER: docs_sphinx/_build/html # build/docs_doxygen/html- name: Deploy
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs_sphinx/_build/html # FOLDER: build/docs_doxygen/html
-
In the above snippet, the Sphinx style is run. To change to doxygen, switch statements to:
run: cd build
(run: cd docs_sphinx
before)&& cmake ..
(&& make html
before)&& make docs
(&& cd _build/html
before)- delete
&& touch .nojekyll
FOLDER: build/docs_doxygen/html
(FOLDER: docs_sphinx/_build/html
before)
-
git add .
,git commit
andgit push
which triggers automatic deployment
Links for resources on the doxygen-sphinx-breathe + webpage setup I followed to set up this workflow:
- Medium 3part blog:
- https://medium.com/practical-coding/c-documentation-with-doxygen-cmake-sphinx-breathe-for-those-of-use-who-are-totally-lost-7d555386fe13
- https://medium.com/practical-coding/c-documentation-with-doxygen-cmake-sphinx-breathe-for-those-of-use-who-are-totally-lost-part-2-21f4fb1abd9f
- https://medium.com/practical-coding/c-documentation-with-doxygen-cmake-sphinx-breathe-for-those-of-use-who-are-totally-lost-part-3-d20549d3b01f
- Sources (more elaborated) upon which this blog-series is based on: