Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5b14a71
docs: Ignore auto-generated .rst files for python lib docs
echoix May 31, 2025
154f947
docs: Fix issue with `**kwargs` parameter entry
echoix May 31, 2025
afaf08e
docs: Fix formatting issue of python/grass/pygrass/utils.py create_te…
echoix May 31, 2025
1bdefa5
Fix lists in field list formatting in docstring
echoix May 28, 2025
9977d31
docs: Fix typo in docstring of python/grass/pygrass/utils.py findmaps()
echoix May 31, 2025
66ae957
docs: Fix ascii diagram formatting issue of python/grass/pygrass/util…
echoix May 31, 2025
7314870
docs: Fix formatting issue of python/grass/pygrass/utils.py create_te…
echoix May 31, 2025
b39b4c4
docs: Fix formatting issues of unescaped substitutions or emphasis
echoix May 31, 2025
f86d12f
docs: Fix formatting issue of bullet list of TemporalOperatorParser.p…
echoix May 31, 2025
588ef2c
docs: Fix formatting of return vales in python/grass/temporal/metadat…
echoix May 31, 2025
385b4ea
mkdocs: Create python api docs with mkdocstrings and griffe
echoix May 31, 2025
7f702aa
mkdocs: Output grass markdown docs with griffe
echoix May 31, 2025
20edc3e
Merge branch 'main' into mkdocstrings-griffe-01
echoix Jun 15, 2025
8938078
docs: Skip building sphinx in CI
echoix Jun 15, 2025
596bf40
mkdocs: install mkdocstrings[python]
echoix Jun 15, 2025
e4c40ed
mkdocs: Add mkdocs-api-autonav to requirements.txt
echoix Jun 15, 2025
a155d80
mkdocs: Set paths for mkdocstrings
echoix Jun 15, 2025
ee67e38
Add force_inspection option to mkdocs.yml plugins
echoix Jun 15, 2025
5a09cd3
mkdocs: Run inside grass session
echoix Jun 15, 2025
4d95ef0
mkdocs: exclude more of autonav
echoix Jun 15, 2025
cac7ecf
mkdocs: Filter private methods
echoix Jun 15, 2025
39fd209
Remove grass_api copy.md file entirely
echoix Jun 15, 2025
458dd93
docs: Try alternative formatting for RegionManager docstrings
echoix Jun 15, 2025
5d198ce
mkdocs: Add numpy and python object inventories
echoix Jun 15, 2025
e94bac4
Merge branch 'main' into mkdocstrings-griffe-01
echoix Jun 19, 2025
9b3e5aa
Merge branch 'main' into mkdocstrings-griffe-01
echoix Jul 2, 2025
e9ca8f0
Update raster.py
echoix Jul 2, 2025
a0b4aa4
Merge branch 'main' into mkdocstrings-griffe-01
echoix Jul 5, 2025
bd8a581
Update python/grass/script/raster.py
echoix Jul 5, 2025
4060844
docs: Fix raises docstring syntax in grass/pygrass/vector/geometry.py
echoix Jul 5, 2025
ee18ef1
docs: Hide dunder from mkdocstrings python generated docs
echoix Jul 5, 2025
bb48f18
mkdocs: Other mkdocs changes
echoix Jul 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ jobs:
- name: Get mkdocs
run: |
pip install -r "grass/man/mkdocs/requirements.txt"
pip install 'mkdocstrings[python]'

- name: Run mkdocs
run: |
Expand All @@ -155,10 +156,12 @@ jobs:
cd ..
export SITE_NAME="GRASS $VERSION Documentation"
export COPYRIGHT="© 2003-$YEAR GRASS Development Team, GRASS $VERSION Documentation"
export GRASS_PYTHON_DIR="$(grass --config python_path)"
cd $MKDOCS_DIR
mkdocs build
grass --tmp-project XY --exec mkdocs build

- name: Build Sphinx documentation
if: false
run: |
pip install -r "grass/python/grass/docs/requirements.txt"
cd grass
Expand All @@ -167,6 +170,7 @@ jobs:
mv -v dist.$ARCH/docs/html/libpython $MKDOCS_DIR/site

- name: Merge Sphinx and MkDocs Sitemaps
if: false
run: |
cd grass
python utils/merge_sitemaps.py \
Expand Down
54 changes: 52 additions & 2 deletions man/mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# Project information
site_author: The GRASS Development Team # Default author to all pages
site_name: !ENV SITE_NAME
site_name: !ENV [SITE_NAME, 'GRASS $VERSION Documentation']
site_url: https://grass.osgeo.org/grass-stable/manuals/

# Repository information
Expand All @@ -14,7 +14,7 @@
use_directory_urls: false

# Copyright
copyright: !ENV COPYRIGHT
copyright: !ENV [COPYRIGHT, '© 2003-$YEAR GRASS Development Team, GRASS $VERSION Documentation']

# Theme configuration
theme:
Expand Down Expand Up @@ -82,6 +82,56 @@
plugins:
- search
- glightbox
- api-autonav:
exclude:
- "grass.lib"
- "ctypes"
- "grass.lib.ctypes_preamble.ctypes"
- "grass.lib.ctypes_preamble"
- grass.temporal.unit_tests
- grass.pygrass.modules.shortcuts
modules: [../../etc/python/grass]
- mkdocstrings:
handlers:
python:
inventories:
- https://numpy.org/doc/stable/objects.inv
- https://docs.python.org/3/objects.inv
options:
docstring_style: sphinx
# allow_inspection: true
force_inspection: true
preload_modules:
- grass.script
# - grass
# - numpy
show_if_no_docstring: true
summary: true
parameter_headings: true
show_signature_annotations: true
filters:
- "!^_[^_]"
- "!^unit_tests"
# load_external_modules: true
# docstring_style: sphinx
paths:
- !ENV [GRASS_PYTHON_DIR, '.']
- '.'
- !ENV [LD_LIBRARY_PATH, '.']

# paths: [/home/vscode/grass/dist.x86_64-pc-linux-gnu/lib, /home/vscode/grass/dist.x86_64-pc-linux-gnu/etc/python, /home/vscode/grass/dist.x86_64-pc-linux-gnu/docs/mkdocs]

Check failure on line 122 in man/mkdocs/mkdocs.yml

View workflow job for this annotation

GitHub Actions / Additional checks

122:121 [line-length] line too long (181 > 120 characters)

Check warning on line 122 in man/mkdocs/mkdocs.yml

View workflow job for this annotation

GitHub Actions / Additional checks

122:11 [comments-indentation] comment not indented like content
# paths: [/home/vscode/grass/dist.x86_64-pc-linux-gnu/etc/python, .]
# paths: [/home/vscode/grass/dist.x86_64-pc-linux-gnu/etc/python/grass]

# modules: [../../etc/python/grass, ., ]

Check warning on line 126 in man/mkdocs/mkdocs.yml

View workflow job for this annotation

GitHub Actions / Additional checks

126:7 [comments-indentation] comment not indented like content
# - mkdocs-autoapi
# # - mkdocs-autoapi:
# # autoapi_dir: /home/vscode/grass/dist.x86_64-pc-linux-gnu/etc/python/grass
# - mkdocstrings:
# handlers:
# python:
# paths: [/home/vscode/grass/dist.x86_64-pc-linux-gnu/etc/python]

- tags:
tags_name_property: keywords
tags_slugify_format: "{slug}"
Expand Down
1 change: 1 addition & 0 deletions man/mkdocs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ mkdocs-material==9.6.14
pymdown-extensions==10.16
pyyaml-env-tag==1.1
mkdocs-material[imaging]==9.6.14
mkdocs-api-autonav
9 changes: 6 additions & 3 deletions python/grass/script/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,13 @@
The original region is saved at the beginning of the context and restored at the end.
Example with explicit region parameters:

Check failure on line 424 in python/grass/script/raster.py

View workflow job for this annotation

GitHub Actions / Python Code Quality Checks (ubuntu-22.04)

Ruff (W293)

python/grass/script/raster.py:424:1: W293 Blank line contains whitespace
.. code-block:: pycon
>>> with gs.RegionManager(n=226000, s=222000, w=634000, e=638000):
... gs.parse_command("r.univar", map="elevation", format="json")
>>> with gs.RegionManager(n=226000, s=222000, w=634000, e=638000):
... gs.parse_command("r.univar", map="elevation", format="json")
Example matching a raster map's region:
Example matching a raster map's region::
>>> with gs.RegionManager(raster="elevation"):
... gs.run_command("r.slope.aspect", elevation="elevation", slope="slope")
Expand All @@ -436,6 +438,7 @@
... gs.run_command("g.region", n=226000, s=222000, w=634000, e=638000)
... gs.parse_command("r.univar", map="elevation", format="json")
Example2 using :func:`~grass.script.raster.RegionManager.set_region`:
Example using :py:func:`~grass.script.raster.RegionManager.set_region`:
>>> with gs.RegionManager() as manager:
Expand Down
Loading