Skip to content

g.extension: Install markdown documentation for addons#7676

Merged
petrasovaa merged 3 commits into
OSGeo:mainfrom
petrasovaa:g.extension-markdown-support
Jul 15, 2026
Merged

g.extension: Install markdown documentation for addons#7676
petrasovaa merged 3 commits into
OSGeo:mainfrom
petrasovaa:g.extension-markdown-support

Conversation

@petrasovaa

Copy link
Copy Markdown
Contributor

This PR makes g.extension install the generated Markdown documentation for addons, and adds Markdown and man page generation to the CMake addon build.

Motivation: GRASS is moving from HTML to Markdown as the documentation source (#7540, #7674), but installed addons shipped only the HTML page and man page — the generated Markdown was thrown away. Once HTML is removed, Markdown is the only full documentation format, so addons need to install it. One of the prerequisites for removing the HTML build.

Changes:

  • The addon install rules in Module.make/Script.make install the Markdown page and its images into docs/mkdocs/source/ in the addon prefix; g.extension creates the directory on install and removes the page on uninstall.
  • build_addon.cmake now generates the Markdown page and a man page — CMake-built addons previously shipped HTML only, with no man page at all (needs g.md2man in the installed GRASS: Autotools since doc: generate man pages from markdown #7540, CMake
    with CMake: Build man pages from markdown #7674).
  • Tests check the installed Markdown files.

update_manual_page() intentionally stays HTML-only: nothing follows links in the installed Markdown today (man pages drop link targets; the online addons manual build does its own linking). To be revisited with the HTML removal if a Markdown-based help viewer appears.

AI disclosure: implemented and verified by Claude (Fable) with install and remove round trips of a sample addon through both the make-based and CMake-based paths.

Extend the addon install rules in Module.make and Script.make to
install the generated markdown page and its images into
docs/mkdocs/source in the addon prefix, next to the existing HTML and
man page. g.extension creates the directory on install and removes the
markdown page on uninstall.

Generate markdown and man pages also in the CMake addon build
(build_addon.cmake), which previously produced only HTML pages and no
man pages at all. This requires g.md2man in the installed GRASS
(shipped by the Autotools build since OSGeo#7540 and by the CMake build
since OSGeo#7674).

update_manual_page() intentionally remains HTML-only: it rewrites
relative links for the browser-based help, while the installed
markdown has no consumer that follows links (man pages drop link
targets, and the online addons manual build does its own linking).

Extend the g.extension tests to check the installed markdown files.

Generated with AI assistance (Claude Fable); verified with install and
remove round trips of a sample addon through both the make-based and
CMake-based paths.
@github-actions github-actions Bot added Python Related code is in Python module general tests Related to Test Suite CMake labels Jul 12, 2026
@petrasovaa
petrasovaa requested a review from nilason July 12, 2026 15:53
@petrasovaa
petrasovaa marked this pull request as draft July 12, 2026 16:44
@petrasovaa

Copy link
Copy Markdown
Contributor Author

The CI won't work right now because it waits for other PR, hence marking it as draft.

@petrasovaa
petrasovaa marked this pull request as ready for review July 14, 2026 20:28
echoix
echoix previously approved these changes Jul 14, 2026

@echoix echoix left a comment

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.

I don’t see something wrong that tickles my eyes here. I didn’t analyze deeply the CMake lines, but I’m confident that your local testing (that Fable did) was enough to prove it works as intended.

…module addons

Unlike the single-module doc command, the multi-module wrapper command did
not set VERSION_NUMBER, which makes parse_source() in mkmarkdown.py fail
with UnboundLocalError when building addon documentation (e.g. i.sentinel).
@petrasovaa

Copy link
Copy Markdown
Contributor Author

The CMake CI failure was caused by the mkmarkdown.py call for multi-module addons (e.g. i.sentinel) not setting SOURCE_URL and VERSION_NUMBER, unlike the single-module command. Without VERSION_NUMBER, parse_source() in mkmarkdown.py fails with UnboundLocalError for addons.

@petrasovaa
petrasovaa requested a review from echoix July 15, 2026 11:52

@nilason nilason left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I haven't tested, but it seems good to me.

@petrasovaa
petrasovaa merged commit 7aec9f2 into OSGeo:main Jul 15, 2026
26 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in GRASS Markdown Documentation Jul 15, 2026
@petrasovaa
petrasovaa deleted the g.extension-markdown-support branch July 15, 2026 20:43
@github-actions github-actions Bot added this to the 8.6.0 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake general module Python Related code is in Python tests Related to Test Suite

Projects

Development

Successfully merging this pull request may close these issues.

3 participants