grass icon indicating copy to clipboard operation
grass copied to clipboard

[Feat] Add JSON examples to tool documentation

Open petrasovaa opened this issue 6 months ago • 2 comments

This issue tracks the progress of JSON output documentation. Ideally, each tool supporting JSON format as output has an example of JSON output (potentially shortened if it's too long) and an example demonstrating the usage in the workflow, ideally in Python. These 2 could be combined. The goal is for users to quickly understand the schema of the output and know how to use it in Python...

Missing example of usage in Python:

  • [ ] r.info needs a Python example, e.g. get min, max #5784
  • [x] g.region needs a Python example, e.g. get latlon coordinates of the center of the region #5785

One option with the new documentation we could add content tabs for command line and Python, having the the same example for both interfaces.

petrasovaa avatar May 21 '25 14:05 petrasovaa

Once PR https://github.com/OSGeo/grass/pull/3884/ is merged please add JSON examples to r.stats.

cwhite911 avatar May 21 '25 17:05 cwhite911

One option with the new documentation we could add content tabs for command line and Python, having the the same example for both interfaces.

Hey @petrasovaa, I added the docs in Markdown, but when I tried to follow the syntax mentioned above, the pre-commit check failed even though the content tabs were showing. After I fixed that, the content tabs didn’t show as expected. What should I do in this case? Should I stick to plain Markdown syntax instead of the MkDocs-specific syntax?

NishantBansal2003 avatar May 27 '25 19:05 NishantBansal2003

Can be closed, as it has already been addressed.

NishantBansal2003 avatar Jun 20 '25 18:06 NishantBansal2003