ansi-to-tui

Crates.ioansi-to-tui
lib.rsansi-to-tui
version7.0.0
sourcesrc
created_at2021-04-30 23:00:51.32654
updated_at2024-10-25 05:12:10.612743
descriptionA library to convert ansi color coded text into ratatui::text::Text type from ratatui library
homepage
repositoryhttps://github.com/uttarayan21/ansi-to-tui
max_upload_size
id391732
size192,375
Orhun Parmaksız (orhun)

documentation

README

ansi-to-tui

drone build github build downloads

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();
Commit count: 101

cargo fmt