Crates.io | coded-chars |
lib.rs | coded-chars |
version | |
source | src |
created_at | 2024-08-28 20:32:46.742255+00 |
updated_at | 2025-03-09 12:21:54.217594+00 |
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 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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 coded_chars::clear_screen;
use coded_chars::cursor::set_position;
use coded_chars::presentation::{format_str, select_graphic};
fn main() {
// Direct format
println!("Hello {}World{}!", select_graphic().fg_red().bold().underline(), select_graphic().default());
// Clear screen
clear_screen();
// Using format_str
let fmt_world = format_str(
"World",
select_graphic().fg_red().bold().underline()
);
println!("Hello {fmt_world}!");
set_position(5, 1).exec();
println!("This line is printed on the fifth line.");
}
Result:
This crate development is achieved.
Contact the author at dev@trehinos.eu.
© 2024 Sébastien Geldreich
MIT License