1
0
Fork
You've already forked text_table_formatter
0
No description
  • Rust 100%
2025年10月24日 21:44:59 +02:00
src First release 2025年10月24日 20:23:55 +02:00
.gitignore Init 2025年10月18日 13:25:46 +02:00
Cargo.lock Added detection if formatting has changed and showing difference 2025年10月20日 23:34:39 +02:00
Cargo.toml First release 2025年10月24日 20:23:55 +02:00
Changelog.md Adjusted changelog and Readme according to 1. release 2025年10月24日 21:44:59 +02:00
LICENSE First release 2025年10月24日 20:23:55 +02:00
README.md Adjusted changelog and Readme according to 1. release 2025年10月24日 21:44:59 +02:00

Purpose

This CLI tool allows you to format a file containing tables in the markdown style. It aligns rows of a text table. It adds extra spaces into cells smaller than the biggest found cell within a column of a table.

Supported Platform

I think it should work on BSD, Linux, Windows and Mac systems. However I only test on Linux and will only official support this on Linux.

Installation

Building youself

  1. Git clone this project
  2. Change into this project
  3. Run cargo install --path . inside this cloned project

Download the application

  1. You can download the binary at this link
  2. Unpack the archive and put binary where PATH can find it.

Add completion

Output the following command where you source your completions for you shell. Example for bash

text_table_formatter --completion bash > <path_to_completion_folder>/text_table_formatter.sh

Do not forget to source this completion script in your rc shell file. For example your bashrc.

Man page

Generate the man page

text_table_formatter --man text text_table_formatter.1

Compress it

gzip text_table_formatter.1

Copy it to a path within MANPATH. Usually one would use /usr/local/share/man/man1/text_table_formatter.1.gz

sudo install -m 0644 ./text_table_formatter.1.gz /usr/local/share/man/man1 

Examples

Given this not formatted table.

| Tables | Are | Cool |
|----------|:-------------:|------:|
| col 1 is | left-aligned | 1600ドル |
| col 2 is | centered | 12ドル |
| col 3 is | right-aligned | 1ドル |

Running the following command reading the unformatted input within a file

text_table_formatter file_to_format.md ```
Or via piping
```sh
... | text_table_formatter 

You can get a formatted ouput to stdout

| Tables | Are | Cool |
|----------|:-------------:|------:|
| col 1 is | left-aligned | 1600ドル |
| col 2 is | centered | 12ドル |
| col 3 is | right-aligned | 1ドル |

Note: All lines not containing the delimiter character, "|" by default , are not formatted at all.
It should not remova or add lines, only changes lines which needs formatting.

Maintance Status

I do not intend to add more feature to this application. I might react to issues addressing critical bugs however.

I plan to introduce rpm and deb packages.

License

This application is licensd unter the following MIT license