Skip to content

Commit af8300c

Browse files
authored
Merge pull request #239 from tshepang/misplaced
move misplaced example
2 parents 1ec7762 + 793a882 commit af8300c

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/book/mod.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ pub struct MDBook {
3737
impl MDBook {
3838
/// Create a new `MDBook` struct with root directory `root`
3939
///
40+
/// # Examples
41+
///
42+
/// ```no_run
43+
/// # extern crate mdbook;
44+
/// # use mdbook::MDBook;
45+
/// # use std::path::Path;
46+
/// # fn main() {
47+
/// let book = MDBook::new(Path::new("root_dir"));
48+
/// # }
49+
/// ```
50+
///
51+
/// In this example, `root_dir` will be the root directory of our book and is specified in function
52+
/// of the current working directory by using a relative path instead of an absolute path.
53+
///
4054
/// Default directory paths:
4155
///
4256
/// - source: `root/src`
@@ -286,18 +300,6 @@ impl MDBook {
286300
/// Parses the `book.json` file (if it exists) to extract the configuration parameters.
287301
/// The `book.json` file should be in the root directory of the book.
288302
/// The root directory is the one specified when creating a new `MDBook`
289-
///
290-
/// ```no_run
291-
/// # extern crate mdbook;
292-
/// # use mdbook::MDBook;
293-
/// # use std::path::Path;
294-
/// # fn main() {
295-
/// let mut book = MDBook::new(Path::new("root_dir"));
296-
/// # }
297-
/// ```
298-
///
299-
/// In this example, `root_dir` will be the root directory of our book and is specified in function
300-
/// of the current working directory by using a relative path instead of an absolute path.
301303
302304
pub fn read_config(mut self) -> Self {
303305

0 commit comments

Comments
 (0)