2018-10-09 12:33:43 +00:00
|
|
|
mod config;
|
|
|
|
pub mod highlighting;
|
2018-10-31 07:18:57 +00:00
|
|
|
mod theme;
|
2019-12-21 21:52:39 +00:00
|
|
|
pub use crate::config::{Config, Language, LinkChecker, Taxonomy};
|
2017-08-24 23:38:03 +00:00
|
|
|
|
2018-10-09 12:33:43 +00:00
|
|
|
use std::path::Path;
|
2017-03-06 14:45:57 +00:00
|
|
|
|
2017-03-03 08:12:40 +00:00
|
|
|
/// Get and parse the config.
|
|
|
|
/// If it doesn't succeed, exit
|
2017-03-25 04:18:15 +00:00
|
|
|
pub fn get_config(path: &Path, filename: &str) -> Config {
|
|
|
|
match Config::from_file(path.join(filename)) {
|
2017-03-03 08:12:40 +00:00
|
|
|
Ok(c) => c,
|
|
|
|
Err(e) => {
|
2017-03-25 04:18:15 +00:00
|
|
|
println!("Failed to load {}", filename);
|
2017-03-03 08:12:40 +00:00
|
|
|
println!("Error: {}", e);
|
|
|
|
::std::process::exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|