mtf

Crates.iomtf
lib.rsmtf
version0.3.5
created_at2025-04-26 15:13:15.186863+00
updated_at2025-11-14 12:50:01.224684+00
descriptionMarkdown Table Formatter
homepage
repositoryhttps://github.com/qtfkwk/mtf
max_upload_size
id1650339
size25,102
(qtfkwk)

documentation

README

Markdown Table Formatter

CLI

$ cat table.md
w | x | y | z
---|:---|---:|:---:
1 | 1 | 1 | 1
2 | 4 | 16 | 256
3 | 9 | 81 | 6561
4 | 16 | 256 | 65536

$ mtf table.md
| w  | x  |   y |   z   |
|----|:---|----:|:-----:|
| 1  | 1  |   1 |   1   |
| 2  | 4  |  16 |  256  |
| 3  | 9  |  81 | 6561  |
| 4  | 16 | 256 | 65536 |

Text Editor

  1. Use a text editor (Vim, Neovim, Helix Editor, ...)
  2. Select Markdown table content in a file (in Helix Editor type ␛x then x repeatedly, or type ␛v then hjkl or arrows)
  3. Pass it as input to mtf (in Helix Editor type |mtf⏎)
  4. mtf formats the table content

Library

let input = "\
w | x | y | z
---|:---|---:|:---:
1 | 1 | 1 | 1
2 | 4 | 16 | 256
3 | 9 | 81 | 6561
4 | 16 | 256 | 65536

";

let output = "\
| w  | x  |   y |   z   |
|----|:---|----:|:-----:|
| 1  | 1  |   1 |   1   |
| 2  | 4  |  16 |  256  |
| 3  | 9  |  81 | 6561  |
| 4  | 16 | 256 | 65536 |

";

assert_eq!(mtf::process(input).unwrap(), output);
Commit count: 5

cargo fmt