Skip to main content

markdown_ppp/plaintext_printer/
config.rs

1/// Configuration for plaintext rendering output.
2///
3/// # Examples
4///
5/// ```rust
6/// use markdown_ppp::plaintext_printer::config::Config;
7///
8/// let config = Config::default().with_width(120);
9/// ```
10pub struct Config {
11    pub(crate) width: usize,
12}
13
14impl Default for Config {
15    fn default() -> Self {
16        Self { width: 80 }
17    }
18}
19
20impl Config {
21    /// Set the line width for pretty-printing plaintext output.
22    pub fn with_width(self, width: usize) -> Self {
23        Self { width }
24    }
25}