Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SUBDIRS = \
include $(MODULE_TOPDIR)/include/Make/Dir.make

FILES := $(wildcard *.html)
# So far, we disntinguished user and contributor documentation here by
# So far, we distinguished user and contributor documentation here by
# extension. This is no longer possible with Markdown.
MDFILES := grass_database.md \
projectionintro.md \
Expand Down
17 changes: 13 additions & 4 deletions python/grass/docs/_templates/sphinx/apidoc/package.rst.jinja
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{%- macro automodule(modname, options) -%}
{%- macro automodule(modname, options, noindex=False) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- if noindex %}
:no-index:
{%- endif %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
Expand All @@ -24,7 +27,10 @@
{% endif %}

{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{# Root grass package keeps full index; subpackages use no-index to avoid
duplicating index entries that the parent already generates recursively. #}
{%- set _pkg_noindex = pkgname != "grass" %}
{{ automodule(pkgname, automodule_options, noindex=_pkg_noindex) }}
{% endif %}

{%- if subpackages %}
Expand All @@ -44,7 +50,7 @@ Submodules
{% if show_headings %}
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
{% endif %}
{{ automodule(submodule, automodule_options) }}
{{ automodule(submodule, automodule_options, noindex=True) }}
{% endfor %}
{%- endif %}
{%- endif %}
Expand All @@ -53,5 +59,8 @@ Submodules
Module contents
---------------

{{ automodule(pkgname, automodule_options) }}
{# Root grass package keeps full index; subpackages use no-index to avoid
duplicating index entries that the parent already generates recursively. #}
{%- set _pkg_noindex = pkgname != "grass" %}
{{ automodule(pkgname, automodule_options, noindex=_pkg_noindex) }}
{% endif %}
29 changes: 27 additions & 2 deletions python/grass/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import string
from shutil import copy


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -89,7 +90,7 @@
)

grass_version = core.version()["version"]
today = date.today()
today = date.today().strftime("%B %d, %Y")

copy("_templates/layout.html.template", "_templates/layout.html")

Expand All @@ -114,6 +115,31 @@
"sphinx_sitemap",
]

# When building docs, compiled GRASS extension modules (C libraries) may not
# be importable; mock them so autodoc can proceed using the pure-Python
# checkout sources.
autodoc_mock_imports = ["grass.lib", "grass.lib.gis"]
Comment on lines +118 to +121

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'm curious to see what it'll generate. I'll probably want to do a diff of the generated artifacts before and after (this PR) to see what pages miss content.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@echoix Do you see any differences?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image Image Image Image

Here, the links are gone:

Image Image

Here too ("Bases: CalledModuleError" isn't linked anymore)

Image Image

@neteler neteler Jul 10, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Labels restored in e426ab0 and 25c9c33

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still the list entries in dist.x86_64-pc-linux-gnu/docs/html/libpython/pygrass_gis.html are no longer hyperlinks. Weird...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s probably something else in the PR, not only this line… but I don’t know easily without diffing after each change incrementally. Or we let it « degrade » the output docs just to have it done



# Skip temporal lexer rule methods because their regex docstrings are not intended
# for reStructuredText parsing and only serve PLY token definitions.
def skip_member(app, what, name, obj, skip, options):
if name.startswith("t_"):
mod = getattr(obj, "__module__", None)
if mod in {
"grass.temporal.temporal_algebra",
"grass.temporal.temporal_operator",
"temporal.temporal_algebra",
"temporal.temporal_operator",
}:
return True
return None


def setup(app):
app.connect("autodoc-skip-member", skip_member)


# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -192,7 +218,6 @@
"repo_url": "https://github.com/OSGeo/grass/",
"repo_name": "GRASS",
"repo_type": "github",
"logo": "grass_logo.svg",
Comment thread
echoix marked this conversation as resolved.
# Visible levels of the global TOC; -1 means unlimited
"globaltoc_depth": 1,
# If False, expand all TOC entries
Expand Down
2 changes: 1 addition & 1 deletion python/grass/docs/src/gunittest_running_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Currently there is full support only for running all the tests in
the small (basic) version of GRASS sample Location for North Carolina
(see `GRASS sample data`).

.. _GRASS sample data: https://grass.osgeo.org/download/sample-data
.. _GRASS sample data: https://grass.osgeo.org/download/data


Example Bash script to run be used as a cron job
Expand Down
5 changes: 2 additions & 3 deletions python/grass/docs/src/gunittest_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,9 @@ Further reading
gunittest_running_tests


.. _unittest: https://docs.python.org/2/library/unittest.html
.. _doctest: https://docs.python.org/2/library/doctest.html
.. _unittest: https://docs.python.org/3/library/unittest.html
.. _Coverity Scan: https://scan.coverity.com/
.. _1038: https://scan.coverity.com/projects/1038
.. _Cppcheck: http://cppcheck.sourceforge.net/
.. _sandbox: https://svn.osgeo.org/grass/sandbox/wenzeslaus/grass_py_static_check.py
.. _GRASS sample data: https://grass.osgeo.org/download/data/ and http://fatra.cnr.ncsu.edu/data/ (nc_spm_full_v2beta1)
.. _GRASS sample data: https://grass.osgeo.org/sampledata/north_carolina/ (nc_spm_full_v2beta1.tar.gz)
23 changes: 12 additions & 11 deletions python/grass/docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ at various levels:
* `grass.jupyter package <grass.jupyter.html>`_ offers classes and setup functions for
running GRASS in Jupyter Notebooks
* `Testing GRASS source code and modules <gunittest_testing.html>`_ using gunittest package
* `exceptions package <exceptions.html>`_ contains exceptions used by other packages
* `exceptions package <grass.exceptions.html>`_ contains exceptions used by other packages
* `imaging package <imaging.html>`_ is a library to create animated images and films
* `pydispatch package <pydispatch.html>`_ is a library for signal-dispatching

Expand All @@ -40,14 +40,15 @@ Additional Resources
Modules and Packages
--------------------
.. toctree::
:maxdepth: 1
:maxdepth: 1

index
grass.tools
script_intro
pygrass_index
grass.jupyter
exceptions
imaging
pydispatch
gunittest_testing
grass
grass.tools
script_intro
pygrass_index
grass.jupyter
exceptions
imaging
pydispatch
temporal_framework
gunittest_testing
Comment on lines +45 to +54

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to remove grass.tools ? It seems like a new api that could have been replaced if the ai tool based itself on old pages
And index is missing too, was it useful?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have restored grass.tools in 1357dd2, good point.

Re: index: keeping it leads to:

/home/mneteler/software/grass_main/python/grass/docs/src/index.rst:42: WARNING: toctree contains reference to nonexisting document 'index' [toc.not_readable]

Loading