8000 GitHub - Trehinos/coded-chars: ECMA-48 standard implementation for coded characters in rust
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Trehinos/coded-chars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coded chars

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.

Standard implemented

  • ecma-48 - Control Functions for Coded Character Sets

Documentation

On docs.rs

An example

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:
Console

Current status

This crate development is achieved.

Contact the author at dev@trehinos.eu.

License

© 2024 Sébastien Geldreich
MIT License

About

ECMA-48 standard implementation for coded characters in rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0