From 67afd67d4d51a00079269d431a7058fc50750886 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Tue, 7 Oct 2025 15:05:47 +0200 Subject: 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 --- src/config.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/config.rs') 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, +} + 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() }, } } -- cgit v1.2.3