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