Struct mdbook::book::MDBook [] [src]

pub struct MDBook {
    pub root: PathBuf,
    pub config: Config,
    pub book: Book,
    // some fields omitted
}

The object used to manage and build a book.

Fields

The book's root directory.

The configuration used to tweak now a book is built.

A representation of the book's contents in memory.

Methods

impl MDBook
[src]

[src]

Load a book from its root directory on disk.

[src]

Load a book from its root directory using a custom config.

Important traits for BookItems<'a>
[src]

Returns a flat depth-first iterator over the elements of the book, it returns an BookItem enum: (section: String, bookitem: &BookItem)

for item in book.iter() {
    match *item {
        BookItem::Chapter(ref chapter) => {},
        BookItem::Separator => {},
    }
}

// would print something like this:
// 1. Chapter 1
// 1.1 Sub Chapter
// 1.2 Sub Chapter
// 2. Chapter 2
//
// etc.

[src]

init() gives you a BookBuilder which you can use to setup a new book and its accompanying directory structure.

The BookBuilder creates some boilerplate files and directories to get you started with your book.

book-test/
├── book
└── src
    ├── chapter_1.md
    └── SUMMARY.md

It uses the path provided as the root directory for your book, then adds in a src/ directory containing a SUMMARY.md and chapter_1.md file to get you started.

[src]

Tells the renderer to build our book and put it in the build directory.

Important traits for &'a mut W
[src]

You can change the default renderer to another one by using this method. The only requirement is for your renderer to implement the Renderer trait

Important traits for &'a mut W
[src]

Register a Preprocessor to be used when rendering the book.

[src]

Run rustdoc tests on the book, linking against the provided libraries.

[src]

The logic for determining where a backend should put its build artefacts.

If there is only 1 renderer, put it in the directory pointed to by the build.build_dir key in Config. If there is more than one then the renderer gets its own directory within the main build dir.

i.e. If there were only one renderer (in this case, the HTML renderer):

  • build/
    • index.html
    • ...

Otherwise if there are multiple:

  • build/
    • epub/
      • my_awesome_book.epub
    • html/
      • index.html
      • ...
    • latex/
      • my_awesome_book.tex

[src]

Get the directory containing this book's source files.

[src]

Get the directory containing the theme resources for the book.

Trait Implementations

Auto Trait Implementations

impl !Send for MDBook

impl !Sync for MDBook