Open lzachmann opened 2 years ago
Big lift has been made. Still need to find a Sphinx directive to parse docstrings in src/ directory for an "Internals" menu in the docs.
@vlandau I think napoleon may be the way to go? It allows for more natural docstring (e.g., Google or NumPy style) formatting. And napoleon actually comes with Sphinx now, so no need to pip install anything else. But we may need to make files in source modules, however....
https://sphinxcontrib-napoleon.readthedocs.io/en/latest/ https://gist.github.com/GLMeece/222624fc495caf6f3c010a8e26577d31
In our case, the docstrings from each submodule would be parsed using sphinx-apidoc -f -o source/ ../src
.
We are using GitHub Actions to do two things: 1) build the Docker image we are using for this work (which is now available for download or use in other actions via the container registry: https://github.com/orgs/csp-inc/packages/container/package/fluvius), and 2) use this image to compile the project docs using Sphinx.
Contributing to the docs
Local development (recommended)
From 'docs/' directory in a shell running in the container, run
make clean html
. Sphinx uses the 'instructions' in 'docs/source' to build the site. We serve the site from 'docs/build/html/' using GitHub Pages on an orphanedgh-pages
branch.On the remote
Commits pushed to any of the paths / branches specified in the gh-pages.yml workflow (https://github.com/csp-inc/fluvius/blob/ljz/dev/.github/workflows/gh-pages.yml#L5-L14) will trigger a rebuild.
Resources
The docs workflow was cobbled together / inspired by a variety of resources: