typst_library/text/lorem.rs
1use crate::foundations::{Str, func};
2
3/// Creates blind text.
4///
5/// This function yields a Latin-like _Lorem Ipsum_ blind text with the given
6/// number of words. The sequence of words generated by the function is always
7/// the same but randomly chosen. As usual for blind texts, it does not make any
8/// sense. Use it as a placeholder to try layouts.
9///
10/// # Example
11/// ```example
12/// = Blind Text
13/// #lorem(30)
14///
15/// = More Blind Text
16/// #lorem(15)
17/// ```
18#[func(keywords = ["Blind Text"])]
19pub fn lorem(
20 /// The length of the blind text in words.
21 words: usize,
22) -> Str {
23 lipsum::lipsum(words).replace("--", "–").into()
24}