Crates.io | ansitok-forked |
lib.rs | ansitok-forked |
version | 0.2.0 |
source | src |
created_at | 2024-08-23 07:10:27.789513 |
updated_at | 2024-08-23 07:10:27.789513 |
description | A library for parsing ANSI Escape Codes |
homepage | https://gitlab.com/zhiburt/ansitok |
repository | https://gitlab.com/zhiburt/ansitok |
max_upload_size | |
id | 1348763 |
size | 83,135 |
This is a library for parsing ANSI escape sequences.
The list of covered sequences.
use ansitok::{parse_ansi, Output};
fn main() {
let text = "\x1b[31;1;4mHello World\x1b[0m";
for output in parse_ansi(text) {
match output {
Output::Text(text) => println!("Got a text: {:?}", text),
Output::Escape(esc) => println!("Got an escape sequence: {:?}", esc),
}
}
}
no_std
supportno_std
is supported via disabling the std
feature in your Cargo.toml
.
The project got an insiration from https://gitlab.com/davidbittner/ansi-parser.