2015-07-17 00:20:36 +08:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
|
|
|
pub struct BookConfig {
|
|
|
|
dest: PathBuf,
|
|
|
|
src: PathBuf,
|
2015-07-18 06:04:20 +08:00
|
|
|
indent_spaces: i32,
|
2015-07-17 00:20:36 +08:00
|
|
|
multilingual: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl BookConfig {
|
|
|
|
pub fn new() -> Self {
|
|
|
|
BookConfig {
|
|
|
|
dest: PathBuf::from("book"),
|
|
|
|
src: PathBuf::from("src"),
|
2015-07-18 06:04:20 +08:00
|
|
|
indent_spaces: 4,
|
2015-07-17 00:20:36 +08:00
|
|
|
multilingual: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn dest(&self) -> PathBuf {
|
|
|
|
self.dest.clone()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_dest(mut self, dest: PathBuf) -> Self {
|
|
|
|
self.dest = dest;
|
|
|
|
self
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn src(&self) -> PathBuf {
|
|
|
|
self.src.clone()
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn set_src(mut self, src: PathBuf) -> Self {
|
|
|
|
self.src = src;
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|