Rich terminals. follows Python's rich conventions

Overview

richterm

use richterm::print;
use richterm::text;
use richterm::track;
use richterm::progress;

use std::{thread, time};

fn main() {
    let vec = vec![text(
        "richterm",
        "fg:dark_blue bg:indian_red1 eff:b,i,u,blink,s",
    )];
    print(vec);

    let arr = [text(" supports ", "")];
    print(arr);

    print([
        text(" many ", "bg:sea_green2 fg:black eff:i"),
        text(" features ", ""),
        text(" out of the box", "bg:yellow fg:black"),
        text("\n", ""),
    ]);

    print([
        text("Even", ""),
        text(" some ", "eff:b"),
        text(
            "emojis like :+1: :apple: :bar_chart: :airplane_departure: :baguette_bread: :minibus:",
            "",
        ),
        text("\n", ""),
    ]);

    for _item in track(5, "Downloading ...") {
        let ten_millis = time::Duration::from_millis(5);
        thread::sleep(ten_millis);
    }
    
    let mut tasks = progress();
    let task1 = tasks.add_task("Descr1", 50);
    let task2 = tasks.add_task("Descr2", 50); 
    let task3 = tasks.add_task("Descr3", 50);
    
    while !tasks.finished{
        tasks.update(task1.clone(), 10.0);
        tasks.update(task2.clone(), 5.0);
        tasks.update(task3.clone(), 6.0);
    } 
}

Docs

fg and bg colors

  • rgb(111,111,111)
  • black, red, green, yellow, blue, magenta, cyan, white, bright_black, bright_red, bright_green, bright_yellow, bright_blue, bright_magenta, bright_cyan, bright_white, grey0, gray0, navy_blue, dark_blue, blue3, blue1, dark_green, deep_sky_blue4, dodger_blue3, dodger_blue2, green4, spring_green4, turquoise4, deep_sky_blue3, dodger_blue1, green3, spring_green3, dark_cyan, light_sea_green, deep_sky_blue2, deep_sky_blue1, spring_green2, cyan3, dark_turquoise, turquoise2, green1, spring_green1, medium_spring_green, cyan2, cyan1, dark_red, deep_pink4, purple4, purple3, blue_violet, orange4, grey37, gray37, medium_purple4, slate_blue3, royal_blue1, chartreuse4, dark_sea_green4, pale_turquoise4, steel_blue, steel_blue3, cornflower_blue, chartreuse3, cadet_blue, sky_blue3, steel_blue1, pale_green3, sea_green3, aquamarine3, medium_turquoise, chartreuse2, sea_green2, sea_green1, aquamarine1, dark_slate_gray2, dark_magenta, dark_violet, purple, light_pink4, plum4, medium_purple3, slate_blue1, yellow4, wheat4, grey53, gray53, light_slate_grey, light_slate_gray, medium_purple, light_slate_blue, dark_olive_green3, dark_sea_green, light_sky_blue3, sky_blue2, dark_sea_green3, dark_slate_gray3, sky_blue1, chartreuse1, light_green, pale_green1, dark_slate_gray1, red3, medium_violet_red, magenta3, dark_orange3, indian_red, hot_pink3, medium_orchid3, medium_orchid, medium_purple2, dark_goldenrod, light_salmon3, rosy_brown, grey63, gray63, medium_purple1, gold3, dark_khaki, navajo_white3, grey69, gray69, light_steel_blue3, light_steel_blue, yellow3, dark_sea_green2, light_cyan3, light_sky_blue1, green_yellow, dark_olive_green2, dark_sea_green1, pale_turquoise1, deep_pink3, magenta2, hot_pink2, orchid, medium_orchid1, orange3, light_pink3, pink3, plum3, violet, light_goldenrod3, tan, misty_rose3, thistle3, plum2, khaki3, light_goldenrod2, light_yellow3, grey84, gray84, light_steel_blue1, yellow2, dark_olive_green1, honeydew2, light_cyan1, red1, deep_pink2, deep_pink1, magenta1, orange_red1, indian_red1, hot_pink, dark_orange, salmon1, light_coral, pale_violet_red1, orchid2, orchid1, orange1, sandy_brown, light_salmon1, light_pink1, pink1, plum1, gold1, navajo_white1, misty_rose1, thistle1, yellow1, light_goldenrod1, khaki1, wheat1, cornsilk1, grey100, gray100, grey3, gray3, grey7, gray7, grey11, gray11, grey15, gray15, grey19, gray19, grey23, gray23, grey27, gray27, grey30, gray30, grey35, gray35, grey39, gray39, grey42, gray42, grey46, gray46, grey50, gray50, grey54, gray54, grey58, gray58, grey62, gray62, grey66, gray66, grey70, gray70, grey74, gray74, grey78, gray78, grey82, gray82, grey85, gray85, grey89, gray89, grey93, gray93,

effects

  • b - bold
  • i - italic
  • u - underline
  • blink - blink
  • d - dim
  • r - reverse

emojis

Try github-flavoured shortcodes

track(5, "description")

Progressbar

progress

    let mut tasks = progress();
    let task1 = tasks.add_task("Descr1", 50); // 50 is an arbitrary amount
    let task2 = tasks.add_task("Descr2", 50); 
    let task3 = tasks.add_task("Descr3", 50);
    
    while !tasks.finished{
        tasks.update(task1.clone(), 10.0);  // 10.0 is an arbitrary amount to move the progress bar
        tasks.update(task2.clone(), 5.0);   // 10.0 means 10.0/50.0
        tasks.update(task3.clone(), 6.0);
    } 
You might also like...
Parses .off (Object File Format) files. This implementation follows this spec from the Princeton Shape Benchmark.

off-rs - A simple .off file parser Parses .off (Object File Format) files. This implementation follows this spec from the Princeton Shape Benchmark. S

A CLI tool to deduplicate your Nix flake's inputs as if you added `inputs.*.inputs.*.follows = "*"` everywhere.

Allfollow What is this? Take this flake's inputs, for example. inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; rust-overla

Wealthy Rich ported to Rust! This aims to be a crate for rich text and beautiful formatting in the terminal

Wealthy Rich ported to Rust! This aims to be a crate for rich text and beautiful formatting in the terminal

Safe and rich Rust wrapper around the Vulkan API
Safe and rich Rust wrapper around the Vulkan API

Vulkano See also vulkano.rs. Vulkano is a Rust wrapper around the Vulkan graphics API. It follows the Rust philosophy, which is that as long as you do

The feature-rich, portable async channel library

The feature-rich, portable async channel library crates.io docs.rs Why use Postage? Includes a rich set of channels. | barrier | broadcast | dispa

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.
A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

A feature-rich, production-ready, general purpose 2D/3D game engine written in Rust with a scene editor.

⚑ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted.  Standing on the shoulders of giants.
⚑ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted. Standing on the shoulders of giants.

✨ Feature Rich | ⚑ Insanely Fast An ultra-fast, adaptable deployment of the tantivy search engine via REST. 🌟 Standing On The Shoulders of Giants lnx

⚑ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted.  Standing on the shoulders of giants.
⚑ Insanely fast, 🌟 Feature-rich searching. lnx is the adaptable deployment of the tantivy search engine you never knew you wanted. Standing on the shoulders of giants.

✨ Feature Rich | ⚑ Insanely Fast An ultra-fast, adaptable deployment of the tantivy search engine via REST. 🌟 Standing On The Shoulders of Giants lnx

πŸ–₯  A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3
πŸ–₯ A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3

πŸ–₯ A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3

A library to display rich (Markdown) snippets and texts in a rust terminal application
A library to display rich (Markdown) snippets and texts in a rust terminal application

A CLI utilities library leveraging Markdown to format terminal rendering, allowing separation of structure, data and skin. Based on crossterm so works

A lightweight but incredibly powerful and feature-rich BitTorrent tracker. Supports UDP + HTTP(S) and a private tracker mode.

Torrust Tracker Project Description Torrust Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent tracker made using Rust. Feat

Terminal based, feature rich, interactive SQL tool

datafusion-tui (dft) DataFusion-tui provides a feature rich terminal application, built with tui-rs, for using DataFusion (and eventually Ballista). I

Discord RIch Presence in Rust, with native Bevy support

Discord Presence The root project for both Bevy Discord Presence and regular Discord Presence, both contained in the crates directory. TODO Allow invi

Fast, minimal, feature-rich, extended formatting syntax for Rust!

Formatting Tools Fast, minimal, feature-rich, extended formatting syntax for Rust! Features include: Arbitrary expressions inside the formatting brace

Date and time library for Rust. Feature rich, lightweight and easy-to-use.

Astrolabe Date and time library for Rust. Feature rich, lightweight and easy-to-use. Documentation | Github | Crate Example Status Astrolabe is curren

A Discord Rich Presence for cmus player using rust πŸ¦€πŸ’™
A Discord Rich Presence for cmus player using rust πŸ¦€πŸ’™

A Discord Rich Presence for cmus player with πŸ¦€ Require cmus Install from crates.io crago install cmus-rpc-rs Options: Option Description Values -h or

An abstraction build on top of discord-rich-presence that makes possible to use it in a more declarative way

Declarative Discord Rich Presence This library is an abstraction build on top of discord-rich-presence crate that allows you to use it in a more decla

Discord Rich Presence for Creative Apps
Discord Rich Presence for Creative Apps

Show your friends what you're working on, be it in Adobe Suite, Autodesk Suite, Cinema 4D or many more! Currently supported: C4D, Adobe Suite, Davinci Resolve, Maya, 3Ds Max, Sony Vegas, Substance suite, Isotropix suite, FL, Ableton, Blender, Cavalry,

nvim-oxi provides safe and idiomatic Rust bindings to the rich API exposed by the Neovim text editor.

πŸ”— nvim-oxi nvim-oxi provides safe and idiomatic Rust bindings to the rich API exposed by the Neovim text editor. The project is mostly intended for p

Comments
  • proper library layout

    proper library layout

    Hello, it would be useful for users if the project was layed out like a library and not a bin package. The main.rs would then live in the examples dir.

    opened by BaerLKR 5
  • concurrency vs. paralellism

    concurrency vs. paralellism

    Like in other languages (JS for example) Rust also hast the concept of asynchronous operations. They are mostly used to wait for IO but in this case I think it would be good to use it instead of spawning a new OS thread. That method of achieving the execution of multiple actions at the same time is mainly meant for resource heavy operations.

    opened by BaerLKR 1
  • Add colors Enum, removed emojis overhead code

    Add colors Enum, removed emojis overhead code

    Fixed #7

    • I don't think you need so large enum / hashmap for emojis!
    • Refer url for emojis shorthand text going forward
    • Added //TODO at place as part of my personal suggestion.

    Let me know if any suggestion in this PR OR any next work @Abdur-rahmaanJ

    opened by nisargparikh69 1
Releases(0.5.0)
  • 0.5.0(Aug 1, 2023)

    What's Changed

    • chore: track as BrogressBar by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/8
    • chore: run cargo fmt by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/9
    • feat: progress by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/10

    Full Changelog: https://github.com/Abdur-rahmaanJ/richterm/compare/0.4.0...0.5.0

    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Jul 30, 2023)

    What's Changed

    • feat: track by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/5
    • chore: fix gif link on README by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/6

    Full Changelog: https://github.com/Abdur-rahmaanJ/richterm/compare/0.3.0...0.4.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jul 29, 2023)

    What's Changed

    • feat: add strikethrough effect by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/1
    • chore: fix warnings by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/2
    • chore: moved emojis and colors to separate files by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/3
    • feat: emoji shortcodes by @Abdur-rahmaanJ in https://github.com/Abdur-rahmaanJ/richterm/pull/4

    New Contributors

    • @Abdur-rahmaanJ made their first contribution in https://github.com/Abdur-rahmaanJ/richterm/pull/1

    Full Changelog: https://github.com/Abdur-rahmaanJ/richterm/compare/0.2.0...0.3.0

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Jul 28, 2023)

Owner
Abdur-Rahmaan Janhangeer
OpenSource :+1:
Abdur-Rahmaan Janhangeer
A CLI tool to deduplicate your Nix flake's inputs as if you added `inputs.*.inputs.*.follows = "*"` everywhere.

Allfollow What is this? Take this flake's inputs, for example. inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; rust-overla

Jacob Birkett 9 Aug 31, 2024
πŸ–₯ A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3

?? A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3

Christian Visintin 574 Jan 5, 2023
A lightweight but incredibly powerful and feature-rich BitTorrent tracker. Supports UDP + HTTP(S) and a private tracker mode.

Torrust Tracker Project Description Torrust Tracker is a lightweight but incredibly powerful and feature-rich BitTorrent tracker made using Rust. Feat

Torrust 162 Dec 31, 2022
Terminal based, feature rich, interactive SQL tool

datafusion-tui (dft) DataFusion-tui provides a feature rich terminal application, built with tui-rs, for using DataFusion (and eventually Ballista). I

null 49 Dec 24, 2022
Fast, minimal, feature-rich, extended formatting syntax for Rust!

Formatting Tools Fast, minimal, feature-rich, extended formatting syntax for Rust! Features include: Arbitrary expressions inside the formatting brace

Casper 58 Dec 26, 2022
nvim-oxi provides safe and idiomatic Rust bindings to the rich API exposed by the Neovim text editor.

?? nvim-oxi nvim-oxi provides safe and idiomatic Rust bindings to the rich API exposed by the Neovim text editor. The project is mostly intended for p

Riccardo Mazzarini 655 Jul 13, 2023
Estratto is a powerful and user-friendly Rust library designed for extracting rich audio features from digital audio signals.

estratto γ€œ An Audio Feature Extraction Library estratto is a powerful and user-friendly Rust library designed for extracting rich audio features from

Amber J Blue 5 Aug 25, 2023
πŸš€ Discord Rich Presence plugin for Neovim written in Rust

?? Cord ?? Cord is a Discord Rich Presence plugin designed for Neovim, written in Rust. ?? Features Lightweight and dependency-free Cross-platform sup

vyfor 39 May 6, 2024
Spawn multiple concurrent unix terminals in Discord

Using this bot can be exceedingly dangerous since you're basically granting people direct access to your shell.

Simon Larsson 11 Jun 1, 2021
A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️

git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers. The changelog template can be customized with a configuration file to match the desired format.

Orhun ParmaksΔ±z 5k Dec 30, 2022