Simple library for creating "command line presentations".
Presentations are composed with the slide
macro, like so:
```rust use clp::crossterm::style::{Print, Stylize}; use clp::{slide, TypewriterPrint, TypewriterPrintStyledContent}; use std::time::Duration;
slide!( TypewriterPrint("Welcome to my presentation on ", Duration::frommillis(25)), TypewriterPrintStyledContent( "command line presentations".bold(), Duration::frommillis(50), ), Print("."), ) .expect("the first slide should appear");
slide!(TypewriterPrint( "...there isn't much content on these slides.", Duration::from_millis(25), )) .expect("the second slide should appear"); ```
This package has one feature: spin_sleep
. It enables the spin_sleep
dependency,
which is a more accurate drop-in replacement for the sleep
function.
It's particularly useful on Windows, which has a notoriously inaccurate sleep
function.
If you notice that TypewriterPrint
or TypewriterPrintStyledContent
is slower than expected,
you should enable the spin_sleep
feature.
bash
cargo add clp -F spin_sleep