Struct mdbook::book::BookBuilder
source · pub struct BookBuilder { /* private fields */ }
Expand description
A helper for setting up a new book and its directory structure.
Implementations§
source§impl BookBuilder
impl BookBuilder
sourcepub fn new<P: Into<PathBuf>>(root: P) -> BookBuilder
pub fn new<P: Into<PathBuf>>(root: P) -> BookBuilder
Create a new BookBuilder
which will generate a book in the provided
root directory.
sourcepub fn with_config(&mut self, cfg: Config) -> &mut BookBuilder
pub fn with_config(&mut self, cfg: Config) -> &mut BookBuilder
Set the Config
to be used.
sourcepub fn copy_theme(&mut self, copy: bool) -> &mut BookBuilder
pub fn copy_theme(&mut self, copy: bool) -> &mut BookBuilder
Should the theme be copied into the generated book (so users can tweak it)?
sourcepub fn create_gitignore(&mut self, create: bool) -> &mut BookBuilder
pub fn create_gitignore(&mut self, create: bool) -> &mut BookBuilder
Should we create a .gitignore
file?
sourcepub fn build(&self) -> Result<MDBook>
pub fn build(&self) -> Result<MDBook>
Generate the actual book. This will:
- Create the directory structure.
- Stub out some dummy chapters and the
SUMMARY.md
. - Create a
.gitignore
(if applicable) - Create a themes directory and populate it (if applicable)
- Generate a
book.toml
file, - Then load the book so we can build it or run tests.
Trait Implementations§
source§impl Clone for BookBuilder
impl Clone for BookBuilder
source§fn clone(&self) -> BookBuilder
fn clone(&self) -> BookBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BookBuilder
impl Debug for BookBuilder
source§impl PartialEq for BookBuilder
impl PartialEq for BookBuilder
source§fn eq(&self, other: &BookBuilder) -> bool
fn eq(&self, other: &BookBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for BookBuilder
Auto Trait Implementations§
impl RefUnwindSafe for BookBuilder
impl Send for BookBuilder
impl Sync for BookBuilder
impl Unpin for BookBuilder
impl UnwindSafe for BookBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more