Crates.io | ansi-to-tui-forked |
lib.rs | ansi-to-tui-forked |
version | 3.0.0-ratatui |
source | src |
created_at | 2022-05-04 03:40:11.360572 |
updated_at | 2023-03-19 17:25:23.504312 |
description | A library to convert ansi color coded text into ratatui::text::Text type from ratatui library |
homepage | |
repository | https://github.com/uttarayan21/ansi-to-tui |
max_upload_size | |
id | 580172 |
size | 51,414 |
A nom parser to parse text with ANSI color codes and turn them into ratatui::text::Text
.
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 |
use ansi_to_tui::IntoText;
let buffer = std::fs::read("ascii/text.ascii").unwrap();
let output = buffer.into_text();