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
sourceimpl 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
sourceimpl Clone for BookBuilder
impl Clone for BookBuilder
sourcefn clone(&self) -> BookBuilder
fn clone(&self) -> BookBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BookBuilder
impl Debug for BookBuilder
sourceimpl PartialEq<BookBuilder> for BookBuilder
impl PartialEq<BookBuilder> for BookBuilder
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &BookBuilder) -> bool
fn ne(&self, other: &BookBuilder) -> bool
This method tests for !=
.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more