Generate API docs from code with sphinx autodoc (#2699)

Expanding on the addition of docstrings in code, this adds python module API docs to sphinx documentation.

A developer can preview what this might look like by running this locally:

```
tox -m docs
```

The option `-W` is added to the tox env so that warning messages are considered errors.

Adds doc generation using the above method to the test GitHub workflow to catch documentation problems on PRs.

Some docstrings have been reformatted and fixed to satisfy errors generated with the above setup.
This commit is contained in:
Matt Baker
2023-08-17 10:27:33 +02:00
committed by GitHub
parent badf1da183
commit b7ea511511
23 changed files with 872 additions and 497 deletions
+24
View File
@@ -174,3 +174,27 @@ jobs:
- uses: jakebailey/pyright-action@v1
with:
version: 1.1.320
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
- name: Install dependencies
run: pip install tox
- name: Install package dependencies
run: |
sudo apt update \
&& sudo apt install -y \
latexmk texlive-latex-extra tex-gyre \
--no-install-recommends
- name: Generate documentation
run: tox -m docs