g.extension: Install markdown documentation for addons#7676
Merged
Conversation
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.
petrasovaa
marked this pull request as draft
July 12, 2026 16:44
Contributor
Author
|
The CI won't work right now because it waits for other PR, hence marking it as draft. |
petrasovaa
marked this pull request as ready for review
July 14, 2026 20:28
echoix
previously approved these changes
Jul 14, 2026
echoix
left a comment
Member
There was a problem hiding this comment.
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).
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. |
echoix
approved these changes
Jul 15, 2026
nilason
approved these changes
Jul 15, 2026
nilason
left a comment
Contributor
There was a problem hiding this comment.
I haven't tested, but it seems good to me.
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.
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:
installrules inModule.make/Script.makeinstall the Markdown page and its images intodocs/mkdocs/source/in the addon prefix; g.extension creates the directory on install and removes the page on uninstall.build_addon.cmakenow generates the Markdown page and a man page — CMake-built addons previously shipped HTML only, with no man page at all (needsg.md2manin the installed GRASS: Autotools since doc: generate man pages from markdown #7540, CMakewith CMake: Build man pages from markdown #7674).
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.