2018-10-09 12:33:43 +00:00
|
|
|
mod config;
|
|
|
|
pub mod highlighting;
|
2018-10-31 07:18:57 +00:00
|
|
|
mod theme;
|
2020-06-29 18:02:05 +00:00
|
|
|
pub use crate::config::{
|
|
|
|
languages::Language, link_checker::LinkChecker, taxonomies::Taxonomy, Config,
|
|
|
|
};
|
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
|
2020-05-23 09:55:45 +00:00
|
|
|
pub fn get_config(filename: &Path) -> Config {
|
|
|
|
match Config::from_file(filename) {
|
2017-03-03 08:12:40 +00:00
|
|
|
Ok(c) => c,
|
|
|
|
Err(e) => {
|
2020-05-23 09:55:45 +00:00
|
|
|
println!("Failed to load {}", filename.display());
|
2017-03-03 08:12:40 +00:00
|
|
|
println!("Error: {}", e);
|
|
|
|
::std::process::exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|