tangled
alpha
login
or
join now
eldridge.cam
/
paper-terminal
0
fork
atom
Print Markdown to a paper in your terminal
0
fork
atom
overview
issues
pulls
pipelines
Get paper to respect the syncat_active_style env var
eldridge.cam
6 years ago
fdf1ce27
0b3aefcd
+7
-1
2 changed files
expand all
collapse all
unified
split
src
dirs.rs
main.rs
+6
src/dirs.rs
···
1
1
use directories::ProjectDirs;
2
2
use std::path::PathBuf;
3
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
12
+
13
13
+
pub fn active_color() -> PathBuf {
14
14
+
let active_color = env::var("syncat_active_style").unwrap_or("active".to_string());
15
15
+
syncat_config().join("style").join(active_color)
16
16
+
}
+1
-1
src/main.rs
···
108
108
109
109
let centering = " ".repeat((terminal_width - width) / 2);
110
110
111
111
-
let stylesheet = File::open(dirs::syncat_config().join("style/active/md.syncat"))
111
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());