Crates.io | coded-chars |
lib.rs | coded-chars |
version | 3.0.1 |
source | src |
created_at | 2024-08-28 20:32:46.742255 |
updated_at | 2024-09-04 11:11:40.323613 |
description | An implementation to create control strings defined in the ECMA-48 standard. |
homepage | |
repository | https://github.com/Trehinos/coded-chars |
max_upload_size | |
id | 1355300 |
size | 147,782 |
This crate implements the ECMA-48 standard for coded characters in rust.
Various constructions are provided to easily add control character and sequences inside text. This crate is compatible with "ANSI terminals".
This crate does not use a concept of "styles" or any kind of abstraction other than ones defined in the standard.
use crate::clear_screen;
use crate::cursor::set_position;
use crate::presentation::{format_str, select_graphic};
// Direct format
println!("Hello {}World{} !", select_graphic().fg_red().bold().underline(), select_graphic().default());
// Clear screen
clear_screen();
// Using format_str
let formatted = format_str(
"World",
select_graphic().fg_red().bold().underline()
);
println!("Hello {} !", formatted);
set_position(5, 1).exec();
println!("This line is printed on the fifth line.");
This crate development is achieved.
Contact the author at dev@trehinos.eu.
© 2024 Sébastien Geldreich
MIT License