Crates.io | ttygrid |
lib.rs | ttygrid |
version | 0.3.0 |
source | src |
created_at | 2021-06-29 23:24:05.982384 |
updated_at | 2023-09-20 05:55:52.458237 |
description | Grid layout engine for tabular data displayed in a TTY |
homepage | |
repository | https://github.com/erikh/ttygrid |
max_upload_size | |
id | 416387 |
size | 33,475 |
ttygrid makes your tables into reactive layouts. You feed it your contents and the columns you want to show, and it will calculate what to show based on the length of text in the table column, and the "priority", an ascending number indicating display priority within the table.
The result is something like this with the demo source here. Padding is allocated for all columns so the tables are presented nicely and orderly.
ttygrid does not work with stream I/O. Terminal I/O only!. At this point, you must detect if you are a TTY before invoking ttygrid calls.
ttygrid uses crossterm underneath the hood to detect the width of the terminal as well as manage colors when they are desired.
Erik Hollensbe github@hollensbe.org