From 8d7970b32d8245de31b8d544373c6d8a5f8d8cc7 Mon Sep 17 00:00:00 2001 From: Michael Bryan Date: Sat, 30 Sep 2017 21:04:05 +0800 Subject: [PATCH] Changed to the new config types --- src/config/mod.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/config/mod.rs b/src/config/mod.rs index 14662095..585bd7f2 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -7,17 +7,17 @@ use serde::Deserialize; use errors::*; -pub mod bookconfig; -pub mod htmlconfig; -pub mod playpenconfig; -pub mod tomlconfig; -pub mod jsonconfig; +// pub mod bookconfig; +// pub mod htmlconfig; +// pub mod playpenconfig; +// pub mod tomlconfig; +// pub mod jsonconfig; // Re-export the config structs -pub use self::bookconfig::BookConfig; -pub use self::htmlconfig::HtmlConfig; -pub use self::playpenconfig::PlaypenConfig; -pub use self::tomlconfig::TomlConfig; +// pub use self::bookconfig::BookConfig; +// pub use self::htmlconfig::HtmlConfig; +// pub use self::playpenconfig::PlaypenConfig; +// pub use self::tomlconfig::TomlConfig; /// The overall configuration object for MDBook. @@ -25,7 +25,7 @@ pub use self::tomlconfig::TomlConfig; #[serde(default)] pub struct Config { /// Metadata about the book. - pub book: BookConfig_, + pub book: BookConfig, /// Arbitrary information which renderers can use during the rendering /// stage. pub output: BTreeMap, @@ -58,7 +58,7 @@ impl Config { /// /// This is for compatibility only. It will be removed completely once the /// rendering and plugin system is established. - pub fn html_config(&self) -> Option { + pub fn html_config(&self) -> Option { self.try_get_output("html").ok() } @@ -96,7 +96,7 @@ fn get_deserialized<'de, T: Deserialize<'de>, S: AsRef>(name: S, table: &BT /// loading it from disk. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[serde(default, rename_all = "kebab-case")] -pub struct BookConfig_ { +pub struct BookConfig { /// The book's title. pub title: Option, /// The book's authors. @@ -111,9 +111,9 @@ pub struct BookConfig_ { pub multilingual: bool, } -impl Default for BookConfig_ { - fn default() -> BookConfig_ { - BookConfig_ { +impl Default for BookConfig { + fn default() -> BookConfig { + BookConfig { title: None, authors: Vec::new(), description: None, @@ -126,7 +126,7 @@ impl Default for BookConfig_ { #[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)] #[serde(default, rename_all = "kebab-case")] -pub struct HtmlConfig_ { +pub struct HtmlConfig { pub theme: Option, pub curly_quotes: bool, pub mathjax_support: bool,