Struct mdbook::config::bookconfig::BookConfig
[−]
[src]
pub struct BookConfig { /* fields omitted */ }
Configuration struct containing all the configuration options available in mdBook.
Methods
impl BookConfig
[src]
fn new<T: Into<PathBuf>>(root: T) -> Self
Creates a new BookConfig
struct with as root path the path given as parameter.
The source directory is root/src
and the destination for the rendered book is root/book
.
let root = PathBuf::from("directory/to/my/book"); let config = BookConfig::new(&root); assert_eq!(config.get_root(), &root); assert_eq!(config.get_source(), PathBuf::from("directory/to/my/book/src")); assert_eq!(config.get_html_config(), &HtmlConfig::new(PathBuf::from("directory/to/my/book")));
fn with_source<T: Into<PathBuf>>(self, source: T) -> Self
Builder method to set the source directory
fn with_title<T: Into<String>>(self, title: T) -> Self
Builder method to set the book's title
fn with_description<T: Into<String>>(self, description: T) -> Self
Builder method to set the book's description
Builder method to set the book's authors
fn from_tomlconfig<T: Into<PathBuf>>(root: T, tomlconfig: TomlConfig) -> Self
fn fill_from_tomlconfig(&mut self, tomlconfig: TomlConfig) -> &mut Self
fn from_jsonconfig<T: Into<PathBuf>>(root: T, jsonconfig: JsonConfig) -> Self
The JSON configuration file is deprecated and should not be used anymore. Please, migrate to the TOML configuration file.
fn fill_from_jsonconfig(&mut self, jsonconfig: JsonConfig) -> &mut Self
The JSON configuration file is deprecated and should not be used anymore. Please, migrate to the TOML configuration file.
fn set_root<T: Into<PathBuf>>(&mut self, root: T) -> &mut Self
fn get_root(&self) -> &Path
fn set_source<T: Into<PathBuf>>(&mut self, source: T) -> &mut Self
fn get_source(&self) -> &Path
fn set_title<T: Into<String>>(&mut self, title: T) -> &mut Self
fn get_title(&self) -> &str
fn set_description<T: Into<String>>(&mut self, description: T) -> &mut Self
fn get_description(&self) -> &str
Returns the authors of the book as specified in the configuration file
fn set_html_config(&mut self, htmlconfig: HtmlConfig) -> &mut Self
fn get_html_config(&self) -> &HtmlConfig
Returns the configuration for the HTML renderer or None of there isn't any
fn get_mut_html_config(&mut self) -> &mut HtmlConfig
Trait Implementations
impl Debug for BookConfig
[src]
impl Clone for BookConfig
[src]
fn clone(&self) -> BookConfig
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for BookConfig
[src]
fn eq(&self, __arg_0: &BookConfig) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &BookConfig) -> bool
This method tests for !=
.