Print Markdown to a paper in your terminal

Get paper to respect the syncat_active_style env var

+7 -1
+6
src/dirs.rs
··· 1 1 use directories::ProjectDirs; 2 2 use std::path::PathBuf; 3 + use std::env; 3 4 4 5 fn syncat_directories() -> ProjectDirs { 5 6 ProjectDirs::from("com", "cameldridge", "syncat").unwrap() ··· 8 9 pub fn syncat_config() -> PathBuf { 9 10 syncat_directories().config_dir().to_owned() 10 11 } 12 + 13 + pub fn active_color() -> PathBuf { 14 + let active_color = env::var("syncat_active_style").unwrap_or("active".to_string()); 15 + syncat_config().join("style").join(active_color) 16 + }
+1 -1
src/main.rs
··· 108 108 109 109 let centering = " ".repeat((terminal_width - width) / 2); 110 110 111 - let stylesheet = File::open(dirs::syncat_config().join("style/active/md.syncat")) 111 + let stylesheet = File::open(dirs::active_color().join("md.syncat")) 112 112 .map_err(Into::into) 113 113 .and_then(|mut file| Stylesheet::from_reader(&mut file)) 114 114 .unwrap_or_else(|_| include_str!("default.syncat").parse::<Stylesheet>().unwrap());