- Rust 100%
| src | First release | |
| .gitignore | Init | |
| Cargo.lock | Added detection if formatting has changed and showing difference | |
| Cargo.toml | First release | |
| Changelog.md | Adjusted changelog and Readme according to 1. release | |
| LICENSE | First release | |
| README.md | Adjusted changelog and Readme according to 1. release | |
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
- Git clone this project
- Change into this project
- Run
cargo install --path .inside this cloned project
Download the application
- You can download the binary at this link
- Unpack the archive and put binary where
PATHcan 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