Skip to content

Commit

Permalink
Move to ratatui
Browse files Browse the repository at this point in the history
  • Loading branch information
sayanarijit authored and uttarayan21 committed Mar 21, 2023
1 parent eec6f86 commit 0446f08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "ansi-to-tui"
version = "2.0.2"
authors = ["Uttarayan Mondal <email@uttarayan.me>"]
edition = "2018"
description = "A library to convert ansi color coded text into tui::text::Text type from tui-rs library"
description = "A library to convert ansi color coded text into ratatui::text::Text type from ratatui library"
keywords = ["ansi", "ascii", "tui", "parser"]
license = "MIT"
readme = "README.md"
Expand All @@ -12,7 +12,7 @@ repository = "https://github.com/uttarayan21/ansi-to-tui"
[dependencies]
nom = "7.1"
simdutf8 = { version = "0.1", optional = true }
tui = { version = "0.*", default-features = false }
tui = { version = "0.*", default-features = false, package = "ratatui" }
thiserror = "1.0"

[dev-dependencies]
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

![drone build](https://img.shields.io/drone/build/uttarayan21/ansi-to-tui?server=https%3A%2F%2Fdrone.uttarayan.me)] [![github build](https://github.com/uttarayan21/ansi-to-tui/actions/workflows/build.yaml/badge.svg)][ansi-to-tui] [![downloads](https://img.shields.io/crates/d/ansi-to-tui)](https://crates.io/crates/ansi-to-tui)

A nom parser to parse text with ANSI color codes and turn them into [`tui::text::Text`][Text].
A nom parser to parse text with ANSI color codes and turn them into [`ratatui::text::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` |
| 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

Expand All @@ -18,5 +18,5 @@ let buffer = std::fs::read("ascii/text.ascii").unwrap();
let output = buffer.into_text();
```

[Text]: https://docs.rs/tui/0.16.0/tui/text/struct.Text.html
[Text]: https://docs.rs/tui/main/ratatui/text/struct.Text.html
[ansi-to-tui]: https://github.com/uttarayan21/ansi-to-tui

0 comments on commit 0446f08

Please sign in to comment.