-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Python reference documentation (#1209)
* Improve Python reference documentation * Fix lint * Add some missing docstrings * Use new ReadTheDocs config format, bake sphinx dependencies and move to MyST * Re-generate plugins and schema docs * Add spatial coordinates doc to main doctree * Simplify the process for building the docs locally * Fix Sphinx warnings * enable GH builds * Modify make.bat to match with the docs Makefile * Add job to detect doc warnings/errors Signed-off-by: Jean-Christophe Morin <[email protected]>
- Loading branch information
1 parent
d9f3e4d
commit d48163e
Showing
50 changed files
with
1,041 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: docs | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
check-links: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Create virtualenv | ||
run: python3 -m venv .venv | ||
|
||
- name: Install dependencies | ||
run: | | ||
source .venv/bin/activate | ||
python -m pip install . | ||
python -m pip install -r docs/requirements.txt | ||
- name: Linkcheck | ||
working-directory: docs | ||
run: | | ||
source ../.venv/bin/activate | ||
set +e | ||
make linkcheck | ||
exit_code=$? | ||
set -e | ||
if [ $exit_code -eq 0 ]; then | ||
echo -e "\n\n=================\nAll links are valid!" | ||
echo "# :heavy_check_mark: Sphinx links" >> $GITHUB_STEP_SUMMARY | ||
echo "All links are valid!" >> $GITHUB_STEP_SUMMARY | ||
else | ||
echo -e "\n\n=================\nFound broken links. Look at the build logs.\n" | ||
echo "# :x: Sphinx links" >> $GITHUB_STEP_SUMMARY | ||
echo "Found broken links. Look at the build logs for additional information." >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
cat _build/linkcheck/output.txt >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
fi | ||
exit $exit_code | ||
check-warnings: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Create virtualenv | ||
run: python3 -m venv .venv | ||
|
||
- name: Install dependencies | ||
run: | | ||
source .venv/bin/activate | ||
python -m pip install . | ||
python -m pip install -r docs/requirements.txt | ||
- name: Check warnings/errors | ||
working-directory: docs | ||
run: | | ||
source ../.venv/bin/activate | ||
set +e | ||
make htmlstrict | ||
exit_code=$? | ||
set -e | ||
if [ $exit_code -eq 0 ]; then | ||
echo -e "\n\n=================\nNo warnings or errors detected!" | ||
echo "# :heavy_check_mark: Sphinx warnings/errors" >> $GITHUB_STEP_SUMMARY | ||
echo "No errors or warnings detected!" >> $GITHUB_STEP_SUMMARY | ||
else | ||
echo -e "\n\n=================\nWarnings and or errors detected; See the summary bellow:\n" | ||
cat _build/htmlstrict/output.txt | ||
echo "# :x: Sphinx warnings/errors" >> $GITHUB_STEP_SUMMARY | ||
echo "Found some warnings or errors:" >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
cat _build/htmlstrict/output.txt >> $GITHUB_STEP_SUMMARY | ||
echo '```' >> $GITHUB_STEP_SUMMARY | ||
fi | ||
exit $exit_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ xcuserdata/ | |
|
||
# These files are generated, don't put them into source control | ||
docs/api | ||
docs/_build | ||
.tox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{{ fullname }} | ||
{{ underline }} | ||
|
||
.. automodule:: {{ fullname }} | ||
:members: | ||
|
||
{% block modules %} | ||
{% if modules %} | ||
.. rubric:: Modules | ||
|
||
.. autosummary:: | ||
:toctree: | ||
:recursive: | ||
{% for item in modules %} | ||
{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} |
Oops, something went wrong.