Docs.rs
  • onefetch-ascii-2.19.0
    • onefetch-ascii 2.19.0
    • Docs.rs crate page
    • MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • o2sh
    • Dependencies
      • owo-colors ^3.5.0 normal
    • Versions
    • 50% of the crate is documented
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate onefetch_ascii

onefetch_ascii2.19.0

  • All Items
  • Structs

Crates

  • onefetch_ascii
?
Change settings

Crate onefetch_ascii

source ·
Expand description

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}")
}

Structs

  • AsciiArt
    Renders an ascii template with the given colors truncated to the correct width.

Results

Query parser error: "Unexpected - (did you mean ->?)".