#terminal-text #terminal #color #printing #tui #cli

minimo

terminal ui library combining alot of things from here and there and making it slightly easier to play with

26 releases

new 0.3.34 Apr 12, 2024
0.3.33 Apr 12, 2024
0.3.31 Mar 30, 2024
0.3.19 Feb 26, 2024
0.1.0 Jan 19, 2024

#20 in #terminal-text

Download history 17/week @ 2024-01-18 7/week @ 2024-02-01 37/week @ 2024-02-08 214/week @ 2024-02-15 1066/week @ 2024-02-22 502/week @ 2024-02-29 96/week @ 2024-03-07 40/week @ 2024-03-14 10/week @ 2024-03-21 213/week @ 2024-03-28 188/week @ 2024-04-04

516 downloads per month
Used in 4 crates

MIT license

72KB
1.5K SLoC

Minimo

Description

Minimo is a minimalistic terminal printing library for Rust, designed to simplify the task of creating colorful and formatted terminal output. It offers a range of features including colorized text output, styled text (bold, italic, underline), and utility functions for enhanced terminal interactions.

Features

  • Colorized text output with simple macros.
  • Text styling (bold, italic, underline).
  • Utility functions for terminal UI elements like dividers and positioned text.
  • Vibrant text with random colorization for characters.
  • Support for terminal header creation with customizable styles.

Installation

Add minimo to your Rust project's Cargo.toml file:

[dependencies]
minimo = "0.1.0"

Usage

Here's a quick example to get you started with minimo:

use minimo::{gray, header, in_bold, in_cyan, in_gray, in_italic, in_magenta, in_underline, in_yellow, show, showln, success, vibrant, yellow, Printable};

fn main() {
    // Displaying a header
    header!(success, "Minimo", "VERSION 0.1.0", "A minimalistic terminal printing library for Rust");

    // Using showln! macro for colorful text segments
    showln!(gray, "You can use ", magenta, "show!", gray, " or ", yellow, "showln!", gray, " macros");
    showln!(gray, "to print text segments in different colors.\n (Make sure each segment starts with a color)");

    // Using show! and showln! macros with Printable trait
    "You can also use ".show();
    "show! ".print(in_magenta);
    "and ".print(in_gray);
    "showln! ".println(in_cyan);
    "macros to print random text segments with formatting.".showln();

    // Additional demonstrations
    "This is a line in gray.".println(in_gray);
    "This line is in yellow.".println(in_yellow);

    // Demonstrating text styling
    "Bold and colorful text: ".show();
    "Bold".print(in_bold);
    ", ".show();
    "Italic".print(in_italic);
    ", and ".show();
    "Underlined".println(in_underline);

    // Showing usage of vibrant function for colorful characters
    "Vibrant text example: ".print(vibrant);
    "Colorful characters!".println(minimo::vibrant);

    // Showing divider and reset line
    minimo::divider();
    "Divider above".showln();
    minimo::reset_line();
    "Reset line used".showln();
}

Dependencies

~2–9.5MB
~61K SLoC