aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorlukeflo2025-10-07 15:05:47 +0200
committerlukeflo2025-10-07 15:05:47 +0200
commit67afd67d4d51a00079269d431a7058fc50750886 (patch)
treed8d259a74fcc52b0272f004fa39a4be95cdb7d6b /src/config.rs
parent34170cfa62df5443a0d8675106c553efec035687 (diff)
downloadbibiman-67afd67d4d51a00079269d431a7058fc50750886.tar.gz
bibiman-67afd67d4d51a00079269d431a7058fc50750886.zip
implement basic citekey formatting:
* Reads patterns and parses them. TODO: * **Fully** sanitize Latex macros * Preprocess complex and regularly used fields like `author` * Write changes to original bib file
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 00a35b7..78cfef9 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -102,6 +102,7 @@ const DEFAULT_CONFIG: &str = r##"
pub struct BibiConfig {
pub general: General,
pub colors: Colors,
+ pub citekey_formatter: CitekeyFormatter,
}
/// Substruct [general] in config.toml
@@ -143,6 +144,11 @@ pub struct Colors {
pub year_color: Color,
}
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
+pub struct CitekeyFormatter {
+ pub fields: Vec<String>,
+}
+
impl Default for BibiConfig {
fn default() -> Self {
Self {
@@ -161,6 +167,7 @@ impl Default for BibiConfig {
custom_column: CustomField::Pubtype,
},
colors: Self::dark_colors(),
+ citekey_formatter: CitekeyFormatter { fields: Vec::new() },
}
}
}
@@ -187,6 +194,7 @@ impl BibiConfig {
} else {
Self::dark_colors()
},
+ citekey_formatter: CitekeyFormatter { fields: Vec::new() },
}
}