Skip to content

Conversation

@saket0187
Copy link
Contributor

Fixes #6305

Problem Description

The Parameters section in MkDocs-generated documentation only displays the "Command line" tab for some modules like v.out.ogr, v.in.ogr etc., while the "Python (grass.script)" and "Python (grass.tools)" tabs are missing. This affects some module documentation pages built with Material for MkDocs.

Root Cause

In lib/gis/parser_md_common.c, the G__md_print_escaped() function was not adding proper indentation after line breaks (\n) in parameter descriptions. Material for MkDocs requires continuation lines within tab blocks to be indented with 4 spaces. Without this indentation, MkDocs exits the tab block prematurely, causing the remaining tabs to not render.

Solution

Modified G__md_print_escaped() to:

  • Add 4-space indentation after newlines: fputs("\\\n ", f);
  • Replace HTML entities ( ) with regular spaces for tab characters
  • Fix code style (default case indentation)

Testing

  • Tested with v.out.ogr and v.in.ogr modules
  • Verified data-tabs="2:3" in generated HTML shows all 3 tabs
  • Compiled and tested on WSL Ubuntu 24.04
  • All three tabs now render correctly in the Parameters section

Before Fix

Only Command line tab visible
485337548-fcfc7b2a-ddd5-4926-bbc3-fdc04961773c

After Fix

All three tabs (Command line, Python grass.script, Python grass.tools) display correctly
Screenshot 2025-12-31 195824

@saket0187 saket0187 changed the title Mkdocs: Fixes missing Parameter tabs in documentation MkDocs: Fixes missing Parameter tabs in documentation Dec 31, 2025
@github-actions github-actions bot added C Related code is in C libraries labels Dec 31, 2025
saket0187 and others added 3 commits December 31, 2025 20:40
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@gulshan-123 gulshan-123 left a comment

Choose a reason for hiding this comment

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

Can you please check if it renders properly in case of <, > ,*, and tab if present in str?
Or is it the case that these can never occur in str?

@saket0187
Copy link
Contributor Author

saket0187 commented Jan 2, 2026

Can you please check if it renders properly in case of <, > ,*, and tab if present in str? Or is it the case that these can never occur in str?

Yes, My PR only changed the tab (\t) (\n) handling. The <&lt;, >&gt;, and *\* escapes remain unchanged and work exactly as before, so their rendering is unaffected.

For consistency, I will make a commit to change the manual case '\n': to use do_escape('\n', "\\\n ") like the others, so that it's easier to understand. Let's wait for maintainers review to confirm the approach!

@gulshan-123
Copy link
Contributor

Thanks for clarifying! I did not checked the macro expansion!

I am +1 on using the macro instead of expansion to make it consistent with other part of code (and maybe to avoid confusion for people like me?)

@petrasovaa
Copy link
Contributor

I think the newline is somewhat special case, so maybe moving it into a separate function G__md_print_escaped_newline or something like that may be better. I was thinking of replacing \n with MD_NEWLINE + \n + indent

Not sure about the other change, it is unrelated.

renovate bot and others added 8 commits January 2, 2026 15:26
CI(deps): Update dependency sphinx to v9.1.0

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…o#6859)

CI(deps): Update dependency pymdown-extensions to v10.20

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…20.1.0 (main) (OSGeo#6817)

* CI(deps): Update pre-commit hook pre-commit/mirrors-clang-format to v20

* CQ: Apply clang-format 20 formatting

* CI: Update DoozyX/clang-format-lint-action to use clang-format 20

* CQ: Change .clang-format config to define C language options (now different from Cpp)

* CQ: Upgrade .clang-format config for renamed/deprecated option AlwaysBreakTemplateDeclarations

* CQ: Remove Cpp-specific formatting options from C options

* CQ: Downgrade clang-format to 20.1.0 to match existing clang-format action

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edouard Choinière <[email protected]>
* wxGUI: Make Define new GRASS project wizard resizable

* wxGUI: ellipsize GIS database path label in location wizard
@github-actions github-actions bot added GUI wxGUI related docker Docker related CI Continuous integration vector Related to vector data processing raster Related to raster data processing Python Related code is in Python C++ Related code is in C++ translation Message translation related module labels Jan 3, 2026
@github-actions github-actions bot added docs imagery tests Related to Test Suite raster3d labels Jan 3, 2026
@saket0187
Copy link
Contributor Author

Closing this PR as it became messy. Created fresh clean PR at #6864 with the requested changes.

@saket0187 saket0187 closed this Jan 3, 2026
@saket0187 saket0187 deleted the fixes-docs-parameter-tabs branch January 3, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C C++ Related code is in C++ CI Continuous integration docker Docker related docs GUI wxGUI related imagery libraries module Python Related code is in Python raster Related to raster data processing raster3d tests Related to Test Suite translation Message translation related vector Related to vector data processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants