Skip to content

Commit

Permalink
Merge pull request #1527: Clarify steps to regenerate developer API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin authored Jul 10, 2024
2 parents 6bc39c1 + 0f60f36 commit 81badd2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,14 @@ jobs:

- run: pip install .[dev]

- run: ./devel/generate-developer-api-docs
- run: ./devel/regenerate-developer-api-docs

- name: Check for changes
run: |
if [[ -n $(git status --porcelain) ]]; then
git add .
git diff --staged >&2
echo "There are changes to the developer API docs. Please regenerate, commit, and push the changes." >&2
echo "There are changes that affect the developer API docs. Please update: <https://github.com/nextstrain/augur/blob/-/docs/contribute/DEV_DOCS.md#regenerating-developer-api-docs>" >&2
echo "If there are changes to the Augur CLI, please manually adjust files under 'docs/usage/cli/'." >&2
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

rm -f docs/api/developer/augur.*

sphinx-apidoc \
--force \
--module-first \
Expand Down
21 changes: 12 additions & 9 deletions docs/contribute/DEV_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,20 @@ Python file must be accompanied by at least one corresponding reStructuredText
file in order to render the pages.
- If a new Python file is added, a new reStructuredText file should be added
under `docs/api/`.
under `docs/api/developer`. This can be done
[using a script](#regenerating-developer-api-docs).
- If the new Python file represents a subcommand of `augur`, a new
reStructuredText file should be added under `docs/usage/cli/` in addition to
the new file under `docs/api/`.
the new file under `docs/api/developer`.
### Regenerating developer API docs
To regenerate the developer API documentation after adding, renaming, or removing an augur
submodule, autogenerate a new API file as follows.
```bash
./devel/regenerate-developer-api-docs
```
### Building documentation
Expand Down Expand Up @@ -357,13 +367,6 @@ Sphinx can build other formats, such as epub. To see other available formats, ru
make -C docs help
```

To update the developer API documentation after adding or removing an augur submodule,
autogenerate a new API file as follows.

```bash
./devel/generate-developer-api-docs
```

To make doc rebuilds faster, Sphinx caches built documentation by default,
which is generally great, but can cause the sidebar of pages to be stale.
You can clean out the cache with:
Expand Down

0 comments on commit 81badd2

Please sign in to comment.