summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorJannik Obermann <jannik.obermann@gmail.com>2022-02-23 01:02:54 +0100
committerEric Huss <eric@huss.org>2023-05-28 14:04:54 -0700
commit7df1d8c838c0e21968666b671885ac185a426fd7 (patch)
tree72a9923b6957fe33f867279ba4b365cbae251e81 /src/config.rs
parent3a51abfcadb90be71199ddf357d74f3300cce1e1 (diff)
Support hidden lines in languages other than Rust
Co-Authored-By: thecodewarrior <5467669+thecodewarrior@users.noreply.github.com>
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index a58a48bc..4641d1a2 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -504,6 +504,8 @@ pub struct HtmlConfig {
/// Playground settings.
#[serde(alias = "playpen")]
pub playground: Playground,
+ /// Code settings.
+ pub code: Code,
/// Print settings.
pub print: Print,
/// Don't render section labels.
@@ -556,6 +558,7 @@ impl Default for HtmlConfig {
additional_js: Vec::new(),
fold: Fold::default(),
playground: Playground::default(),
+ code: Code::default(),
print: Print::default(),
no_section_label: false,
search: None,
@@ -642,6 +645,22 @@ impl Default for Playground {
}
}
+/// Configuration for tweaking how the the HTML renderer handles code blocks.
+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
+#[serde(default, rename_all = "kebab-case")]
+pub struct Code {
+ /// A prefix string to hide lines per language (one or more chars).
+ pub hidelines: HashMap<String, String>,
+}
+
+impl Default for Code {
+ fn default() -> Code {
+ Code {
+ hidelines: HashMap::new(),
+ }
+ }
+}
+
/// Configuration of the search functionality of the HTML renderer.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(default, rename_all = "kebab-case")]