diff --git a/src/lib.rs b/src/lib.rs index aab5ca5d..16ac0ed7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -89,6 +89,7 @@ mod parse; pub mod renderer; pub mod theme; pub mod utils; +pub mod loader; pub use book::MDBook; pub use book::BookItem; diff --git a/src/loader/mod.rs b/src/loader/mod.rs new file mode 100644 index 00000000..eff46441 --- /dev/null +++ b/src/loader/mod.rs @@ -0,0 +1,29 @@ +//! Functionality for loading the internal book representation from disk. + +#![deny(missing_docs)] + +use std::path::{Path, PathBuf}; +use std::error::Error; + + +/// The object in charge of parsing the source directory into a usable +/// `Book` struct. +#[derive(Debug, Clone, PartialEq)] +pub struct Loader { + source_directory: PathBuf, +} + +impl Loader { + /// Create a new loader which uses the provided source directory. + pub fn new>(source_directory: P) -> Loader { + Loader { source_directory: source_directory.as_ref().to_path_buf() } + } + + /// Parse the `SUMMARY.md` file. + pub fn parse_summary(&self) -> Result> { + unimplemented!() + } +} + +/// The parsed `SUMMARY.md`, specifying how the book should be laid out. +pub struct Summary; \ No newline at end of file