markdown_ppp/html_printer/
config.rs

1/// Configuration for HTML rendering output.
2pub struct Config {
3    pub(crate) width: usize,
4    pub(crate) anchor_prefix: String,
5}
6
7impl Default for Config {
8    fn default() -> Self {
9        Self {
10            width: 80,
11            anchor_prefix: String::new(),
12        }
13    }
14}
15
16impl Config {
17    /// Set the line width for pretty-printing HTML output.
18    pub fn with_width(self, width: usize) -> Self {
19        Self { width, ..self }
20    }
21
22    /// Set the prefix for heading anchor IDs.
23    pub fn with_anchor_prefix(self, anchor_prefix: String) -> Self {
24        Self {
25            anchor_prefix,
26            ..self
27        }
28    }
29}