22 releases (9 stable)
5.0.0-rc.1 | Jul 11, 2024 |
---|---|
4.1.0 | Jul 11, 2024 |
4.0.1 | Feb 29, 2024 |
3.1.0 | Jun 23, 2023 |
0.3.0 | Jun 1, 2021 |
#42 in Command-line interface
10,195 downloads per month
Used in 29 crates
(26 directly)
24KB
462 lines
ansi-to-tui
A nom parser to parse text with ANSI color codes and turn them into ratatui::text::Text
.
For people still using tui-rs use version v2.*
for people migrating to ratatui use version v3.*
I recommend switching over to ratatui since tui-rs is currently unmaintained.
Color | Supported | Examples |
---|---|---|
24 bit | ✓ | \x1b[38;2;<R>;<G>;<B>m |
8 bit | ✓ | \x1b[38;5;<N>m |
4 bit | ✓ | \x1b[30..37;40..47m |
Example
use ansi_to_tui::IntoText;
let buffer = std::fs::read("ascii/text.ascii").unwrap();
let output = buffer.into_text();
Dependencies
~7.5MB
~123K SLoC