From 71632fca42977560aaf77dd521b0b6b51319ec17 Mon Sep 17 00:00:00 2001 From: lukeflo Date: Sat, 23 Aug 2025 21:29:35 +0200 Subject: implement a customizable fourth column for `EntryTable` + Now one can select a fourth column to be displayed in the config file + Possible values: journaltitle, organization, institution, publisher, pubtype + Defaults to pubtype --- src/config.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 4e46fdd..e3798e4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -30,7 +30,7 @@ use figment::{ use ratatui::style::Color; use serde::{Deserialize, Serialize}; -use crate::cliargs::CLIArgs; +use crate::{bibiman::bibisetup::CustomField, cliargs::CLIArgs}; const DEFAULT_CONFIG: &str = r##" # [general] @@ -67,6 +67,11 @@ const DEFAULT_CONFIG: &str = r##" # file_symbol = "F" # link_symbol = "L" +## Select a custom column beside standard "author", "title" and "year" +## Possible values are "journaltitle", "organization", "instituion", "publisher" +## and "pubtype" (which is the default) +# custom_column = "pubtype" + # [colors] ## Default values for dark-themed terminal ## Possible values are: @@ -113,6 +118,7 @@ pub struct General { pub note_symbol: String, pub file_symbol: String, pub link_symbol: String, + pub custom_column: CustomField, } /// Substruct [colors] in config.toml @@ -152,6 +158,7 @@ impl Default for BibiConfig { note_symbol: String::from("N"), file_symbol: String::from("F"), link_symbol: String::from("L"), + custom_column: CustomField::Pubtype, }, colors: Self::dark_colors(), } @@ -173,6 +180,7 @@ impl BibiConfig { note_symbol: String::from("N"), file_symbol: String::from("F"), link_symbol: String::from("L"), + custom_column: CustomField::Pubtype, }, colors: if args.light_theme { Self::light_colors() -- cgit v1.2.3