aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorlukeflo2025-07-07 15:17:19 +0200
committerlukeflo2025-07-07 15:17:19 +0200
commitd55cfd8617410545335aeaf895120044c46dde45 (patch)
treebb4a41d32a3715610b8429047a12ec9a6540ee08 /src/config.rs
parent2e4ae7a05a73cb1df63343e14fbb8a5fd3c7bf41 (diff)
parentc0970da999e222cadbcc2242fb67686ed5b00ca4 (diff)
downloadbibiman-d55cfd8617410545335aeaf895120044c46dde45.tar.gz
bibiman-d55cfd8617410545335aeaf895120044c46dde45.zip
Merge pull request 'bibnotes' (#49) from bibnotes into main
- connect bibentries with notes through citekey<>basename matching - use multiple file extensions for note files (plain-text heavily recommended) - create notes for bibentries inside notes dir - use custom symbols as marker for files/links/notes attached to a bibentry
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index f5f2dd0..1f6c619 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -56,6 +56,17 @@ const DEFAULT_CONFIG: &str = r##"
## Use absolute paths (~ for HOME works). Otherwise, loading might not work.
# pdf_path = "/path/to/pdf/folder"
+## Path to folder (with subfolders) containing note files with the basename of
+## the format "citekey.extension". Other basenames are not accepted. The possible
+## extensions can be set through the "note_extensions" array.
+# note_path = "/path/to/notes/folder"
+# note_extensions = [ "md", "txt", "org" ]
+
+## Symbols/chars to show if not has specific attachement
+# note_symbol = "N"
+# file_symbol = "F"
+# link_symbol = "L"
+
# [colors]
## Default values for dark-themed terminal
## Possible values are:
@@ -70,8 +81,15 @@ const DEFAULT_CONFIG: &str = r##"
# confirm_color = "47"
# warn_color = "124"
# bar_bg_color = "234"
+# popup_fg_color = "43"
# popup_bg_color = "234"
# selected_row_bg_color = "237"
+# note_color = "123"
+# file_color = "209"
+# link_color = "39"
+# author_color = "38"
+# title_color = "37"
+# year_color = "135"
"##;
/// Main struct of the config file. Contains substructs/headings in toml
@@ -90,6 +108,11 @@ pub struct General {
pub url_opener: String,
pub file_prefix: Option<PathBuf>,
pub pdf_path: Option<PathBuf>,
+ pub note_path: Option<PathBuf>,
+ pub note_extensions: Option<Vec<String>>,
+ pub note_symbol: String,
+ pub file_symbol: String,
+ pub link_symbol: String,
}
/// Substruct [colors] in config.toml
@@ -103,8 +126,15 @@ pub struct Colors {
pub confirm_color: Color,
pub warn_color: Color,
pub bar_bg_color: Color,
+ pub popup_fg_color: Color,
pub popup_bg_color: Color,
pub selected_row_bg_color: Color,
+ pub note_color: Color,
+ pub file_color: Color,
+ pub link_color: Color,
+ pub author_color: Color,
+ pub title_color: Color,
+ pub year_color: Color,
}
impl Default for BibiConfig {
@@ -117,6 +147,11 @@ impl Default for BibiConfig {
url_opener: select_opener(),
file_prefix: None,
pdf_path: None,
+ note_path: None,
+ note_extensions: None,
+ note_symbol: String::from("N"),
+ file_symbol: String::from("F"),
+ link_symbol: String::from("L"),
},
colors: Self::dark_colors(),
}
@@ -133,6 +168,11 @@ impl BibiConfig {
url_opener: select_opener(),
file_prefix: None,
pdf_path: None,
+ note_path: None,
+ note_extensions: None,
+ note_symbol: String::from("N"),
+ file_symbol: String::from("F"),
+ link_symbol: String::from("L"),
},
colors: if args.light_theme {
Self::light_colors()
@@ -173,8 +213,15 @@ impl BibiConfig {
confirm_color: Color::Indexed(47),
warn_color: Color::Indexed(124),
bar_bg_color: Color::Indexed(235),
+ popup_fg_color: Color::Indexed(43),
popup_bg_color: Color::Indexed(234),
selected_row_bg_color: Color::Indexed(237),
+ note_color: Color::Indexed(123),
+ file_color: Color::Indexed(209),
+ link_color: Color::Indexed(39),
+ author_color: Color::Indexed(38),
+ title_color: Color::Indexed(37),
+ year_color: Color::Indexed(135),
}
}
@@ -187,10 +234,17 @@ impl BibiConfig {
keyword_color: Color::Indexed(58),
info_color: Color::Indexed(57),
bar_bg_color: Color::Indexed(144),
+ popup_fg_color: Color::Indexed(43),
popup_bg_color: Color::Indexed(187),
confirm_color: Color::Indexed(22),
warn_color: Color::Indexed(124),
selected_row_bg_color: Color::Indexed(107),
+ note_color: Color::Indexed(123),
+ file_color: Color::Indexed(209),
+ link_color: Color::Indexed(27),
+ author_color: Color::Indexed(38),
+ title_color: Color::Indexed(37),
+ year_color: Color::Indexed(135),
}
}