Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.
/ clp Public archive

Simple library for creating "command line presentations".

License

Notifications You must be signed in to change notification settings

valentinegb/clp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Archival Notice

This project was straightforward and I worked on it for a few days. I won't be making any more changes. Feel free to fork it.


clp

Simple library for creating "command line presentations".

clp_presentation example video

Presentations are composed with the slide macro, like so:

use clp::{crossterm, slide, TypewriterPrint, TypewriterPrintStyledContent};
use crossterm::style::{Print, Stylize};
use std::time::Duration;

slide!(
    TypewriterPrint("Welcome to my presentation on ", Duration::from_millis(25)),
    TypewriterPrintStyledContent(
        "command line presentations".bold(),
        Duration::from_millis(50),
    ),
    Print("."),
)
.expect("the first slide should appear");

slide!(TypewriterPrint(
    "\n...there isn't much content on these slides.",
    Duration::from_millis(25),
))
.expect("the second slide should appear");

Features

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.

cargo add clp -F spin_sleep