Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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 %}
38 changes: 36 additions & 2 deletions python/grass/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import string
from shutil import copy

from _pickleable import table_fix, derender_toc
Comment thread
neteler marked this conversation as resolved.
Outdated

# 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 +91,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 +116,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 +219,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 Expand Up @@ -243,6 +269,14 @@
],
}

# Make html_context cacheable by replacing theme's class objects with
# pickleable proxy instances. The theme stores class objects (type instances)
# in html_context which Sphinx's is_serializable() conservatively rejects.
html_context = {
"table_fix": table_fix,
"derender_toc": derender_toc,
}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []

Expand Down
7 changes: 2 additions & 5 deletions python/grass/docs/src/gunittest_testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ caused by C library functions does not influence the main testing process.

Some tests will run without any data but many tests require
the small (basic) version of GRASS sample Location for North Carolina
(see `GRASS sample data`).
(see `GRASS sample data testing`).
Comment thread
neteler marked this conversation as resolved.
Outdated

Basic example
-------------
Expand Down Expand Up @@ -506,8 +506,6 @@ However, do not use use doctest for tests of edge cases, for tests which require
generate complex data first, etc. In these cases use `gunittest`.


.. _test-as-scripts:

Tests as general scripts
------------------------

Expand Down Expand Up @@ -716,9 +714,8 @@ Further reading


.. _unittest: https://docs.python.org/2/library/unittest.html
Comment thread
neteler marked this conversation as resolved.
Outdated
.. _doctest: https://docs.python.org/2/library/doctest.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/download/data/ and http://fatra.cnr.ncsu.edu/data/ (nc_spm_full_v2alpha2)

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 the v2 alpha 2 really the successor of v2 beta 1?

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 guess not but this is what is stored in the fatra server. Maybe something missing there, @wenzeslaus ?

@neteler neteler Jun 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.

Found the nc_spm_full_v2beta1.tar.gz file on the server, updated in a0b135c

27 changes: 12 additions & 15 deletions python/grass/docs/src/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,28 @@ 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

--------------------
Additional Resources
--------------------
* `GRASS Python introduction <manuals/python_intro.html>`_ provides a general overview of
* `GRASS Python introduction <../python_intro.html>`_ provides a general overview of
the Python interface to GRASS.
* `GRASS Jupyter notebooks introduction <manuals/jupyter_intro.html>`_ provides an overview of how to use the **grass.jupyter** module.

.. _GRASS: https://grass.osgeo.org/
* `GRASS Jupyter notebooks introduction <../jupyter_intro.html>`_ provides an overview of how to use the **grass.jupyter** module.

--------------------
Modules and Packages
--------------------
.. toctree::
:maxdepth: 1
:maxdepth: 1

index
grass.tools
script_intro
pygrass_index
grass.jupyter
exceptions
imaging
pydispatch
gunittest_testing
grass
script_intro
pygrass_index
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]

4 changes: 0 additions & 4 deletions python/grass/docs/src/pygrass_gis.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _GRASSdatabase-label:

GRASS database management
=========================

Expand All @@ -16,8 +14,6 @@ database management (locations and mapsets) can be found in the `GRASS
User's Manual: GRASS Quickstart
<https://grass.osgeo.org/grass-devel/manuals/helptext.html>`_.

.. _Region-label:

Region management
=================

Expand Down
2 changes: 0 additions & 2 deletions python/grass/docs/src/pygrass_raster.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _raster-label:

Introduction to Raster classes
==============================

Expand Down
Loading