Skip to content

veeso/fmt-md-tables

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fmt-md-tables

license-mit repo-stars downloads latest-version python-versions conventional-commits

ci

Format markdown tables in a file so columns align.

Install

With uv — install as a global CLI tool:

uv tool install .

Editable / dev:

uv pip install -e .

Run without installing:

uvx --from . fmt-md-tables FILE

From PyPI (once published):

uv tool install fmt-md-tables

Usage

fmt-md-tables FILE                 # print formatted output to stdout
fmt-md-tables FILE1 FILE2 ...      # process many files (concatenated to stdout)
fmt-md-tables -i FILE1 FILE2 ...   # rewrite each file in place
fmt-md-tables -                    # read from stdin

Features

  • Pads cells to max column width per table.
  • Preserves alignment markers (:---, :---:, ---:).
  • Skips fenced code blocks (``` and ~~~).
  • Handles escaped pipes (\|).
  • Pads short rows with empty cells.

Example

Input:

| Filter | Index plan | Notes |
|--------|-----------|-------|
| `Filter::eq("col", val)` | Exact match | Best case |
| `Filter::ge("col", val)` | Range scan (start bound) | Uses linked-leaf traversal |

Output:

| Filter                   | Index plan               | Notes                      |
| ------------------------ | ------------------------ | -------------------------- |
| `Filter::eq("col", val)` | Exact match              | Best case                  |
| `Filter::ge("col", val)` | Range scan (start bound) | Uses linked-leaf traversal |

License

MIT

About

Format markdown tables in a file so columns align.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages