Repository navigation
docs: Reduce Sphinx build warnings and fix broken links - #7526
Merged
Merged
Conversation
Fix Sphinx build warnings and broken cross-references `.rst` fixes (cross-references, toctree, unused labels): - `index.rst`: fixes broken relative links (`../python_intro.html`, `../jupyter_intro.html`); added `exceptions` and `temporal_framework` to the toctree (were producing document isn't included in any toctree warnings); removed duplicate toctree entries (`grass.tools`, `grass.jupyter`, `grass.exceptions`) that were already covered by the parent `grass` entry - `gunittest_testing.rst`: renamed duplicate label `GRASS sample data` to `GRASS sample data testing` to resolve sphinx `duplicate label` conflict with `gunittest_running_tests.rst`; removed unused `test-as-scripts` and `doctest` label definitions - `pygrass_gis.rst`: removed unused `GRASSdatabase-label` and `Region-label` definitions - `pygrass_raster.rst`: removed unused `raster-label` definition `conf.py` fixes (config errors, lexer docstrings, theme options): - fixed `today` type mismatch (`date` → `str` via `.strftime()`) - added `autodoc_mock_imports = ["grass.lib", "grass.lib.gis"]` to mock C extension modules during autodoc - added `skip_member` filter to skip PLY lexer `t_*` methods in `temporal_algebra` and `temporal_operator` (their regex docstrings are not intended for RST parsing, were causing `Unknown target name` errors). - added pickleable `html_context` proxy to replace `sphinx_material` theme class objects (`TableFix`, `DerenderToc`) which sphinx cannot cache (fixes `cannot cache unpickleable configuration value` warning). - removed unsupported logo option from `html_theme_options`. Template fix (duplicate object descriptions): - `package.rst.jinja`: Added `:no-index:` to automodule directives for subpackages and submodules in the auto-generated API docs template. The root `grass` package keeps full index entries; subpackages use `:no-index:` to avoid duplicating entries already generated by the parent.
echoix
reviewed
Jun 8, 2026
echoix
reviewed
Jun 8, 2026
petrasovaa
reviewed
Jun 9, 2026
petrasovaa
reviewed
Jun 9, 2026
8 tasks done
Member
|
I checked the diff of the artifact I refreshed yesterday, vs the one on main. See #7526 (comment). Some links to code are now gone. The navigation added at the bottom is nice. The TOC of individual pages has less items in it now, it doesn't matter that much. I didn't look at all the pages |
Revert the no-index template change: the :no-index: option removes cross-reference targets, not just index entries, and because sphinx-apidoc also runs per subpackage (root package names pygrass, exceptions, etc.), it removed the link targets from nearly every generated page. This restores the hyperlinks reported missing in the PR review at the cost of re-admitting three duplicate object description warnings caused by re-exports in grass.pygrass.modules. Remove autodoc_mock_imports: the docs build runs inside a GRASS session where grass.lib is importable, and mocking a real module distorts the documented pygrass classes that use ctypes structures. Make the GRASS sample data references actual links (a trailing underscore is required; with default_role literal they rendered as code) and remove the parenthetical tarball name from the link target, where docutils would join it into a malformed URL. Keep the exceptions bullet and toctree pointing to the same legacy page, and keep the conventional toctree indentation. The changes were reviewed and generated with Claude Code.
Member
|
AI summary of the current state: I pushed df04c67 to this branch (maintainer edit) applying the fixes worked out in wenzeslaus#11:
Verification (docs built from this branch): all warnings this PR targets are gone, and the generated HTML confirms the cross-reference links are back. Remaining warnings (out of scope here):
|
wenzeslaus
approved these changes
Jul 13, 2026
wenzeslaus
enabled auto-merge (squash)
July 13, 2026 09:48
neteler
added a commit
that referenced
this pull request
Jul 13, 2026
Fix the today config type, skip PLY lexer docstrings in autodoc, remove the unsupported logo theme option, correct the toctree entries, and make the sample data links work again. The initial changes were AI-assisted (OpenCode with DeepSeek), the review and follow-up fixes used Claude Code (with Fable). --------- Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com> Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
echoix
added a commit
to wenzeslaus/grass
that referenced
this pull request
Jul 14, 2026
Fix the today config type, skip PLY lexer docstrings in autodoc, remove the unsupported logo theme option, correct the toctree entries, and make the sample data links work again. The initial changes were AI-assisted (OpenCode with DeepSeek), the review and follow-up fixes used Claude Code (with Fable). --------- Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com> Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
This was referenced Jul 17, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I played around with the terminal based
OpenCodetool, a open source AI coding agent (https://opencode.ai/).To try something hopefully useful, I let it fix the broken crosslinks in the sphinx based docs, using DeepSeek Flash free.
Goal: let
make sphinxdoclibrun free of errors and warnings.A critical review is desired.
Original warnings and errors:
This PR collects the sphinx code changes:
.rstfixes (cross-references, toctree, unused labels):index.rst: fixes broken relative links (../python_intro.html,../jupyter_intro.html); addedexceptionsandtemporal_frameworkto the toctree (were producing document isn't included in any toctree warnings); removed duplicate toctree entries (grass.tools,grass.jupyter,grass.exceptions) that were already covered by the parentgrassentrygunittest_testing.rst: renamed duplicate labelGRASS sample datatoGRASS sample data testingto resolve sphinxduplicate labelconflict withgunittest_running_tests.rst; removed unusedtest-as-scriptsanddoctestlabel definitionspygrass_gis.rst: removed unusedGRASSdatabase-labelandRegion-labeldefinitionspygrass_raster.rst: removed unusedraster-labeldefinitionconf.pyfixes (config errors, lexer docstrings, theme options):todaytype mismatch (date→strvia.strftime())autodoc_mock_imports = ["grass.lib", "grass.lib.gis"]to mock C extension modules during autodocskip_memberfilter to skip PLY lexert_*methods intemporal_algebraandtemporal_operator(their regex docstrings are not intended for RST parsing, were causingUnknown target nameerrors).html_contextproxy to replacesphinx_materialtheme class objects (TableFix,DerenderToc) which sphinx cannot cache (fixescannot cache unpickleable configuration valuewarning).html_theme_options.Template fix (duplicate object descriptions):
package.rst.jinja: Added:no-index:to automodule directives for subpackages and submodules in the auto-generated API docs template. The rootgrasspackage keeps full index entries; subpackages use:no-index:to avoid duplicating entries already generated by the parent.If acceptable (as is or modified), I recommend to backport it to G85.