| Crates.io | ansi-builder |
| lib.rs | ansi-builder |
| version | 0.1.6 |
| created_at | 2021-05-25 00:57:57.392468+00 |
| updated_at | 2021-06-06 14:05:33.461215+00 |
| description | Rust crate that will have tools to construct ansi control sequences. |
| homepage | |
| repository | https://github.com/ParagonPawns/ansi-builder |
| max_upload_size | |
| id | 401628 |
| size | 15,696 |
ANSI builder is a library that allows you to build and execute ansi control sequences. This repository is currently a work in progress and might have frequent changes to design (will try to keep design changes to a minimum).
More details on using the library can be found in the examples/ directory.
Also https://github.com/ParagonPawns/term-inquiry is on of our projects that
use this.
use ansi_builder::AnsiBuilder;
AnsiBuilder::new()
.color().fg().red()
.text("This text will be red")
.print() // prints out what we currently have to the terminal.
.reset_attributes()
.text("this text will be default)
.println(); // prints out what we have to the terminal and goes to next line.
use ansi_builder::AnsiBuilder;
AnsiBuilder::new()
.cursor().save() // saves current cursor positon
.text("just writing stuff")
.println()
.text("more stuff")
.println()
.cursor().restore() // brings cursor where we saved
.erase_display(EraseMode::Everything)
.print();