Fixed the code examples and added no_run to prevent them from running
This commit is contained in:
parent
731149d37a
commit
20bfcd128d
|
@ -9,6 +9,9 @@ handlebars = "*"
|
||||||
rustc-serialize = "*"
|
rustc-serialize = "*"
|
||||||
pulldown-cmark = "*"
|
pulldown-cmark = "*"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
tempdir = "*"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["output"]
|
default = ["output"]
|
||||||
debug = []
|
debug = []
|
||||||
|
|
20
src/lib.rs
20
src/lib.rs
|
@ -17,7 +17,7 @@
|
||||||
//!
|
//!
|
||||||
//! ## Example
|
//! ## Example
|
||||||
//!
|
//!
|
||||||
//! ```ignore
|
//! ```no_run
|
||||||
//! extern crate mdbook;
|
//! extern crate mdbook;
|
||||||
//!
|
//!
|
||||||
//! use mdbook::MDBook;
|
//! use mdbook::MDBook;
|
||||||
|
@ -41,9 +41,23 @@
|
||||||
//!
|
//!
|
||||||
//! And then you can swap in your renderer like this:
|
//! And then you can swap in your renderer like this:
|
||||||
//!
|
//!
|
||||||
//! ```ignore
|
//! ```no_run
|
||||||
//! let book = MDBook::new("my-book").set_renderer(your_renderer)
|
//! # extern crate mdbook;
|
||||||
|
//! #
|
||||||
|
//! # use mdbook::MDBook;
|
||||||
|
//! # use mdbook::renderer::HtmlHandlebars;
|
||||||
|
//! # use std::path::Path;
|
||||||
|
//! #
|
||||||
|
//! # fn main() {
|
||||||
|
//! # let your_renderer = HtmlHandlebars::new();
|
||||||
|
//! #
|
||||||
|
//! let book = MDBook::new(Path::new("my-book")).set_renderer(Box::new(your_renderer));
|
||||||
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
//! If you make a renderer, you get the book constructed in form of `Vec<BookItems>` and you get
|
||||||
|
//! the book config in a `BookConfig` struct.
|
||||||
|
//!
|
||||||
|
//! It's your responsability to create the necessary files in the correct directories.
|
||||||
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
Loading…
Reference in New Issue