-
-
Notifications
You must be signed in to change notification settings - Fork 391
MkDocs: Fixes missing Parameter tabs in documentation #6864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@petrasovaa I've implemented your both suggestions:
Regarding the tab change: I've reverted The newline fix now properly renders all three tabs in the Parameters section. Please let me know if any adjustments are needed! |
|
There is an indent variable in the code calling the escape functions, so it would be good to pass it instead the hardcoded 4 spaces. I take back my suggestions to use a separate function, I don't think it makes sense like that, sorry about that. |
Adding the Also, the implementation cannot be done with the case '\n':
fputs(MD_NEWLINE "\n", f);
fputs(indent, f);
break;is this ok? |
Yes, that's ok.
Yes, the code will be more readable without the macro anyway. |
|
@petrasovaa I have already made the commit. Kindly review and approve it. |
For better readability, get rid of the macro completely for that function, thanks! |
petrasovaa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
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 module documentation pages built with Material for MkDocs.Root Cause
In
lib/gis/parser_md_common.c, theG__md_print_escaped()function was not handling newlines properly for Markdown output. Material for MkDocs requires continuation lines within tab blocks to be indented with 4 spaces. Without proper Markdown line breaks and indentation, MkDocs exits the tab block prematurely, causing the remaining tabs to not render.Solution
Following maintainer feedback, refactored newline handling in
parser_md_common.c:G__md_print_escaped_newline()function for newline special case handlingMD_NEWLINE(two trailing spaces) followed by newline and 4-space indentation<,>,*,\t)This ensures proper Markdown hard line breaks with continuation indentation for MkDocs tab rendering.
Testing
v.out.ograndv.in.ogrmodulesdata-tabs="2:3"with all tabs visibleBefore Fix
Only Command line tab visible

After Fix
All three tabs (Command line, Python grass.script, Python grass.tools) display correctly

Note: This supersedes the previous PR which became messy due to other commits. This is a clean implementation addressing maintainer feedback about keeping newline handling as a separate function.