diff options
author | Michael Bryan <michaelfbryan@gmail.com> | 2018-09-16 14:22:50 +0800 |
---|---|---|
committer | Michael Bryan <michaelfbryan@gmail.com> | 2018-09-16 14:22:50 +0800 |
commit | 206a00915b350fdb5f0fd9dd6107e743b6338612 (patch) | |
tree | 14510635004042fbecb8a9b360f1735e25692467 | |
parent | ced74ca4dd87ff7e0d9618b757e3536a6a472910 (diff) |
Export the mdbook version from the crate root
-rw-r--r-- | src/lib.rs | 6 | ||||
-rw-r--r-- | src/renderer/mod.rs | 4 |
2 files changed, 7 insertions, 3 deletions
@@ -114,6 +114,12 @@ pub mod renderer; pub mod theme; pub mod utils; +/// The current version of `mdbook`. +/// +/// This is provided as a way for custom preprocessors and renderers to do +/// compatibility checks. +pub const MDBOOK_VERSION: &str = env!("CARGO_PKG_VERSION"); + pub use book::BookItem; pub use book::MDBook; pub use config::Config; diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 906f7e27..78d208e2 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -26,8 +26,6 @@ use book::Book; use config::Config; use errors::*; -const MDBOOK_VERSION: &str = env!("CARGO_PKG_VERSION"); - /// An arbitrary `mdbook` backend. /// /// Although it's quite possible for you to import `mdbook` as a library and @@ -78,7 +76,7 @@ impl RenderContext { RenderContext { book: book, config: config, - version: MDBOOK_VERSION.to_string(), + version: ::MDBOOK_VERSION.to_string(), root: root.into(), destination: destination.into(), } |