typst/vendor/lipsum/examples/lipsum.rs
2024-10-16 14:18:46 +03:00

14 lines
494 B
Rust

fn main() {
// Generate lorem ipsum text with Title Case.
let title = lipsum::lipsum_title();
// Print underlined title and lorem ipsum text.
println!("{}\n{}\n", title, str::repeat("=", title.len()));
// First command line argument or "" if not supplied.
let arg = std::env::args().nth(1).unwrap_or_default();
// Number of words to generate.
let n = arg.parse().unwrap_or(25);
// Print n words of lorem ipsum text.
println!("{}", lipsum::lipsum(n));
}