| Crates.io | ftb |
| lib.rs | ftb |
| version | 0.1.0 |
| created_at | 2025-10-28 11:15:09.727038+00 |
| updated_at | 2025-10-28 11:15:09.727038+00 |
| description | A fast CLI tool to format and align Markdown tables |
| homepage | |
| repository | https://github.com/acamino/ftb |
| max_upload_size | |
| id | 1904579 |
| size | 51,753 |
A simple CLI tool to format and align Markdown tables.
This is a Rust port of the JavaScript formatter from markdowntable.com.
cargo install ftb
This installs the ftb binary.
git clone https://github.com/acamino/ftb
cd ftb
cargo install --path .
Pipe a Markdown table through ftb to align its columns:
pbpaste | ftb
Or use with files:
cat table.md | ftb
ftb table.md
ftb table.md > formatted.md
Try it with the demo file:
ftb examples/demo.md
Input:
| h1 | h2 | h3 |
|-|-|-|
| data1 | data2 | data3 |
Output:
| h1 | h2 | h3 |
|-------|-------|-------|
| data1 | data2 | data3 |
Input:
h1 | h2 | h3
-|-|-
data-1 | data-2 | data-3
Output:
| h1 | h2 | h3 |
|--------|--------|--------|
| data-1 | data-2 | data-3 |
Input:
| Header 1 | Header 2 | Header 3 |
|----|---|-|
| data1a | Data is longer than header | 1 |
| d1b | add a cell|
|lorem|ipsum|3|
Output:
| Header 1 | Header 2 | Header 3 |
|----------|----------------------------|----------|
| data1a | Data is longer than header | 1 |
| d1b | add a cell | |
| lorem | ipsum | 3 |
cargo test
cargo build --release
The binary will be available at target/release/ftb.
For ergonomic local testing, choose one of these options:
Option 1: Install locally
cargo install --path .
# Now use: ftb
Option 2: Symlink to /usr/local/bin
ln -s $(pwd)/target/release/ftb /usr/local/bin/ftb
# Now use: ftb anywhere
MIT
Port of the Markdown table formatter from markdowntable.com.