Skip to content

Commit 8ef5a06

Browse files
authored
docs: convert Python API docs to Sphinx Material theme (#5617)
1 parent eb16a2c commit 8ef5a06

21 files changed

+717
-308
lines changed

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ jobs:
160160
161161
- name: Build Sphinx documentation
162162
run: |
163-
pip install sphinx sphinx-sitemap
163+
pip install -r "grass/python/grass/docs/requirements.txt"
164164
cd grass
165165
make sphinxdoclib
166166
ARCH="$(grass --config arch)"

python/grass/docs/Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ libpythonclean:
6060

6161
libpythonapidoc:
6262
@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"
63-
$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../imaging/)
64-
$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../exceptions/)
65-
$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../gunittest/ ../gunittest/multireport.py ../gunittest/multirunner.py ../gunittest/main.py)
66-
$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../pydispatch/)
67-
$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../pygrass/)
68-
$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../script/)
69-
$(call run_grass,$(SPHINXAPIDOC) -T -f -o src/ ../temporal/)
70-
$(call run_grass,$(SPHINXAPIDOC) --module-first -T -f -o src/ ../../grass)
63+
$(call run_grass,$(SPHINXAPIDOC) -T -f -t _templates/sphinx/apidoc/ -o src/ ../imaging/)
64+
$(call run_grass,$(SPHINXAPIDOC) -T -f -t _templates/sphinx/apidoc/ -o src/ ../exceptions/)
65+
$(call run_grass,$(SPHINXAPIDOC) -T -f -t _templates/sphinx/apidoc/ -o src/ ../gunittest/ ../gunittest/multireport.py ../gunittest/multirunner.py ../gunittest/main.py)
66+
$(call run_grass,$(SPHINXAPIDOC) -T -f -t _templates/sphinx/apidoc/ -o src/ ../pydispatch/)
67+
$(call run_grass,$(SPHINXAPIDOC) -T -f -t _templates/sphinx/apidoc/ -o src/ ../pygrass/)
68+
$(call run_grass,$(SPHINXAPIDOC) -T -f -t _templates/sphinx/apidoc/ -o src/ ../script/)
69+
$(call run_grass,$(SPHINXAPIDOC) -T -f -t _templates/sphinx/apidoc/ -o src/ ../temporal/)
70+
$(call run_grass,$(SPHINXAPIDOC) --module-first -T -f -t _templates/sphinx/apidoc/ -o src/ ../../grass)
7171

7272
libpythonhtml: checksphinx
7373
@echo "SPHINXBUILD: Using <$(SPHINXBUILD)>"

python/grass/docs/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# GRASS Python Docs
2+
3+
## Local Development
4+
5+
### Prerequisites
6+
7+
Install the following dependencies from the `requirements.txt` file: in
8+
`python/grass/docs` directory.
9+
10+
* [sphinx (v8.1.3)](https://www.sphinx-doc.org/en/master/changes/8.1.html)
11+
* [sphinx-material (v0.0.36)](https://bashtage.github.io/sphinx-material/)
12+
* [sphinx-sitemap (v2.6.0)](https://sphinx-sitemap.readthedocs.io/en/latest/)
13+
14+
```bash
15+
pip install -r python/grass/docs/requirements.txt
16+
```
17+
18+
### Build the Documentation
19+
20+
To build the documentation, run the following command in the `python/grass/docs`
21+
directory:
22+
23+
```bash
24+
make sphinxdoclib
25+
```
26+
27+
This will generate the documentation in the `dist` directory.
28+
29+
### View the Documentation
30+
31+
To view the documentation, open the `index.html` file in the
32+
`dist/docs/html/libpython`
33+
directory with a local web server.
34+
35+
## CI/CD
36+
37+
The documentation is built and deployed automatically using GitHub Actions.
38+
The workflow is triggered on every push to the `main` branch `.github/workflows/documentation.yml`.

python/grass/docs/_static/favicon.ico

124 KB
Binary file not shown.
23.5 KB
Loading

python/grass/docs/_static/grass_logo.svg

Lines changed: 23 additions & 183 deletions
Loading

0 commit comments

Comments
 (0)