How to Use Sphinx for Writing Docs
How to Get the Dependencies
Using Docker
If you are using Docker, then simply pull the docker image specified below:
image: sphinxdoc/sphinx-latexpdf
Then, after running docker run -it <docker-image-name> /bin/bash
, install the theme we are using with pip install sphinx_rtd_theme
Using Spack
If you are using Spack to provision dependencies, then follow the steps as such:
115 extends: [.ascgit_job, .rzansel_job, .rzansel_regular_job, .build_and_test]
116 needs:
117 - prereq_offline_deps
118 variables:
119 SPACK_ENV_NAME: spectrummpi-cuda-volta-xl
120 SUBMIT_TO_CDASH: false # disable CDash submission, since LLNL systems can't reach them
121 BUILD_WITH_CTEST: "${ENABLE_CDASH}" # but do build with CTest to create the necessary files
122 SUBMIT_ON_ERROR: false # no network access, don't try to send from compute node
from .gitlab-ci.yml
Warning
If you do not have either Docker or Spack locally, you would need to install one of them first.
For Docker, refer to their Get Docker Guide.
For Spack, refer to their Getting Started Guide.
Using Python
With your favorite python package manager, e.g., pip
, install
sphinx
, spinx_multiversion
, and sphinx_rtd_theme
. For
example:
pip install sphinx
pip install sphinx_multiversion
pip install sphinx_rtd_theme
How to Build .rst into .html
After you have the dependencies in your environment, then simply build your documentation as the following:
make html
from .gitlab-ci.yml
Note
You can view the documentation webpage locally on your web browser by passing in the URL as file:///path/to/spiner/doc/sphinx/_build/html/index.html
How to Deploy
Submit a PR with your .rst changes for documentation on Github Spiner
Get your PR reviewed and merged into main
Make sure the
pages
CI job passes in the CI pipeline
As soon as the PR is merged into main, this will trigger the Pages deployment automatically if the pages
CI job passes.
Documentation is available on github-pages and on re-git