inkling-loader 0.1.2

Reveal arbitrary ASCII art as a progress indicator by choosing the order its glyphs appear.
Documentation

inkling

Reveal arbitrary ASCII art as a progress indicator.

Repository · Docs

Inkling revealing ASCII art in rainbow as a task runs

Inkling maps progress onto the order a picture's glyphs appear. A normal bar fills a line; Inkling paints a drawing, one glyph at a time, as your task runs.

Published as inkling-loader because the short name is taken; the import path is inkling.

[dependencies]
inkling-loader = "0.1"
use inkling::Loader;

let loader = Loader::new(1000);
loader.set_message("Downloading");
for _ in 0..1000 {
    do_a_slice_of_work();
    loader.inc(1);
}
loader.finish();

A background thread repaints a live reveal at about 30 fps, inline in the terminal. Updates are lock free, so any thread can report progress. Wrap an iterator or a reader and it advances itself; without a total, Loader::spinner() runs an indeterminate reveal. Off a TTY it prints the finished art once instead of animating, so the same code is correct in a pipe or in CI.

How it reveals

Every ink cell gets a reveal rank in 0..=1, and a cell is visible exactly when rank <= progress. Rank is fixed and monotonic, so the reveal is seekable, resumable, and a pure function of progress. The one pluggable seam is the Ordering trait: Directional (a clean wipe, the default), Geodesic (trace the spine, so a serpent paints tip to tail), or your own.

The core (art, rank, ordering, easing, frame) is pure std with zero dependencies and builds with --no-default-features. Only the live terminal renderer pulls in crossterm, behind the default terminal feature.

More

Full usage, the geodesic write-up, the inkling CLI, and the Python package live in the repository README. ASCII art is from the community at asciiart.eu.

License

MIT. See LICENSE-MIT.