Skip to content

markdown2man.py - Add table support and improve man page formatting - #2

Closed
Sachin-NK wants to merge 2912 commits into
petrasovaa:mainfrom
Sachin-NK:patch-1
Closed

markdown2man.py - Add table support and improve man page formatting#2
Sachin-NK wants to merge 2912 commits into
petrasovaa:mainfrom
Sachin-NK:patch-1

Conversation

@Sachin-NK

Copy link
Copy Markdown

This PR improves the markdown-to-man converter, completing the HTML to markdown migration for better man pages.

New Features

  • Added full table support (converts markdown tables to properly formatted man page tables)
  • Improved parameter/flag detection (better handling of both -flags and parameters)
  • Enhanced code block formatting (now preserves language hints)

** Improvements**

  • Smarter line wrapping (enforces 80-char width for man page compliance)
  • Built-in format validation (checks for required sections and proper formatting)
  • Better list indentation (more accurate nested list rendering)

Testing:

  • Manually verified with:
  • g.region.md and other module docs
  • Complex tables and parameter combinations
  • Nested lists and code blocks

renovate Bot and others added 30 commits February 1, 2025 06:39
* CI(deps): Update black to v25

* style: Set required black version to 25

* style: Format repo with Black 2025 style

* style: Apply `ruff format` changes not conflicting with Black 25

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
…ience (OSGeo#5023)

* style: Disable Flake8 line length checks as handled by our formatting tools

* Apply `ruff format` to potentially unexpected tuples in gui/wxpython/rlisetup/wizard.py

* style: Apply `ruff format`-specific formatting for 2025 style

* style: Disable Flake8 line length checks as handled by our formatting tools

* checks: Replace black with ruff format in pre-commit

* CI: Implement checks and PR suggestions for `ruff format`

* python: Address misplace to and from comments for Rast_copy_cats

* gui: Remove potentially unexpected and unused tuple for SetSelection in rlisetup.wizard
* gui: Early exit loops when possible

Flattens nested conditionals and moves error messages or returns near the top

* gui: Early exit functions

Flattens nested conditionals and moves error messages near the top

* Adjust CheckGCPcount() and return false even when msg is False

* format with ruff format
* doc: reword text to be less verbose r.geomorphon.html

* update remain to remains in r.geomorphon.html

Co-authored-by: Veronica Andreo <veroandreo@gmail.com>

---------

Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
This PR cleans up remaining HTML headers:

- `g.setproj.html`: remove full header (note that `g.setproj` is deprecated
- `r.li.html` and `lrs.html`: fix meta declarations

Addresses OSGeo#4972
…Geo#5053)

Fix links to addons
fix i.ortho.rectify name, wximgview
r.average doesn't exist anymore
replace v/r.in.lidar with v/r.in.pdal in examples and see also
There is only one trailing space in all HTML files, but there is one. This change removes it.
This is the first step in conversion of files with HTML documentation to Markdown.
It makes Git keep the history, esp. blame, for the Markdown file.
HTML will be in place as long as needed, but the primary, canonical file is the Markdown file.
When a tool links raster or vector as a standard keyword, the link to keyword page does not go anywhere because first keyword (aka class or family) is hidden in the keywords index (overview).

This enables most of the keywords with the exception of general and misc which I assume will not be used by non-general tools as keywords.

Fixes OSGeo#5049.

In addition, this changes the variable names for better documentation.
The first keyword needs to be one of the (recognized) tool categories (families), not a custom keyword. r3.flow and raster3d lib tests are using this style.
Addresses issues reported by Coverity Scan and scan-build.
Unused variables are only commented out (keep them as reminders just in case)

In addition; a list of macros is converted to enum, for better handling of code by compilers.
wenzeslaus and others added 28 commits March 7, 2025 09:36
New concept for navigation, index, documentation structure and intro pages for the new Markdown-based MkDocs doc, specifically:

- Completely redesign index page to be Getting started page with overview and just couple links elsewhere.
- Add intro pages for interfaces (for now, getting started with interface and overview of interface are the same pages).
- Change navigation to highlight interfaces, concepts, and tools.

This is a first draft, and several issues should be addressed later. Besides the content, links to addons and libpython need a revision.

Related to issue OSGeo#5162. (Originally raised as index page redesign, but index page does not have to make up for a menu anymore because we do have a menu with MkDocs.)

Selected details:

- Removed old code to build index.html in Python and replaced with a index.md file in Markdown.
- Carefully linked download and tutorials in navigation and files. Links the tutorials site from Getting started.
- Development docs is a placeholder.
- A quickstart.md file considered, but it turned out not to be different from the index itself.
- Add new intro files for interfaces.
- Add a flatten Processing Tools menu by moving intro pages to concepts leaving Processing Tools as more pure API reference, using full_index as index page for Processing Tools.
- Does not include much interfaces in the index page, instead uses a main page for Interfaces to provide an overview and counts on future Getting started guides for each interface. For now, repeats interfaces in getting started, but in the future, these would be shorter intros with more context and less examples.
- Divide command line interface into interactive shell, command exec, and scripting.
- Use command line rather than terminal and shell, and use those only when appropriate.
- As a first draft, it does not include any images.
- For links to Python doc, use absolute URLs with grass-stable.

---------

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
Remove Sphinx Python doc build from Python quality check CI workflow. It is now build in the Documentation workflow.
…ations adding context managers in `scripts/` (OSGeo#5329)

* adding context managers

* some fixes

* update
* CI(deps): Update ruff to v0.9.10

* style: Ignore new Ruff rule unused-unpacked-variable (RUF059)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Edouard Choinière <27212526+echoix@users.noreply.github.com>
Found via codespell
Update FindPROJ to try Config mode first.
…eading (OSGeo#5330)

doc: add missing newline between generated synopsis and description header
* tests: Duplicate common fixtures for scripts/ folder

* pytest: Fix v.db.univar fixtures to run correctly by passing the env vars

* db.univar: Use sort fallback on Windows
Run CI with gettext dependency and WITH_NLS=ON
Co-authored-by: Markus Neteler <neteler@osgeo.org>
@Sachin-NK Sachin-NK changed the title doc: markdown2man.py - Add table support and improve man page formatting markdown2man.py - Add table support and improve man page formatting Mar 24, 2025
@Sachin-NK Sachin-NK closed this Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.