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
impl StructuralPartialEq for BookBuilder
Auto Trait Implementations§
impl Freeze for BookBuilder
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