13 stable releases

new 2.23.1 Jan 1, 2025
2.22.0 Sep 19, 2024
2.21.0 May 7, 2024
2.20.0 Mar 17, 2024
2.16.0 Feb 24, 2023

#23 in #git-tool

Download history 264/week @ 2024-09-14 219/week @ 2024-09-21 132/week @ 2024-09-28 134/week @ 2024-10-05 135/week @ 2024-10-12 135/week @ 2024-10-19 97/week @ 2024-10-26 92/week @ 2024-11-02 75/week @ 2024-11-09 103/week @ 2024-11-16 68/week @ 2024-11-23 79/week @ 2024-11-30 124/week @ 2024-12-07 58/week @ 2024-12-14 48/week @ 2024-12-21 346/week @ 2024-12-28

587 downloads per month
Used in 2 crates

MIT license

15KB
324 lines

ascii

crates.io docs.rs

Provides the primary interface to display ascii art to the terminal.

More info here.

This crate is designed as part of the onefetch project.


lib.rs:

onefetch-ascii

Provides the ascii template interface for onefetch.

use onefetch_ascii::AsciiArt;
use owo_colors::{DynColors, AnsiColors};

const ASCII: &str = r#"
{2}            .:--::////::--.`
{1}        `/yNMMNho{2}////////////:.
{1}      `+NMMMMMMMMmy{2}/////////////:`
{0}    `-:::{1}ohNMMMMMMMNy{2}/////////////:`
{0}   .::::::::{1}odMMMMMMMNy{2}/////////////-
{0}  -:::::::::::{1}/hMMMMMMMmo{2}////////////-
{0} .::::::::::::::{1}oMMMMMMMMh{2}////////////-
{0}`:::::::::::::{1}/dMMMMMMMMMMNo{2}///////////`
{0}-::::::::::::{1}sMMMMMMmMMMMMMMy{2}//////////-
{0}-::::::::::{1}/dMMMMMMs{0}:{1}+NMMMMMMd{2}/////////:
{0}-:::::::::{1}+NMMMMMm/{0}:::{1}/dMMMMMMm+{2}///////:
{0}-::::::::{1}sMMMMMMh{0}:::::::{1}dMMMMMMm+{2}//////-
{0}`:::::::{1}sMMMMMMy{0}:::::::::{1}dMMMMMMm+{2}/////`
{0} .:::::{1}sMMMMMMs{0}:::::::::::{1}mMMMMMMd{2}////-
{0}  -:::{1}sMMMMMMy{0}::::::::::::{1}/NMMMMMMh{2}//-
{0}   .:{1}+MMMMMMd{0}::::::::::::::{1}oMMMMMMMo{2}-
{1}    `yMMMMMN/{0}:::::::::::::::{1}hMMMMMh.
{1}      -yMMMo{0}::::::::::::::::{1}/MMMy-
{1}        `/s{0}::::::::::::::::::{1}o/`
{0}            ``.---::::---..`
"#;

let colors = vec![
    DynColors::Ansi(AnsiColors::Blue),
    DynColors::Ansi(AnsiColors::Default),
    DynColors::Ansi(AnsiColors::BrightBlue)
];

let art = AsciiArt::new(ASCII, colors.as_slice(), true);

for line in art {
    println!("{line}")
}

Dependencies

~125KB