summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bryan <michaelfbryan@gmail.com>2018-09-16 14:27:37 +0800
committerMichael Bryan <michaelfbryan@gmail.com>2018-09-16 14:27:37 +0800
commit5dce5399289cdaa8d3a95fd00ff79f27968e3dce (patch)
treed819048b84e47269a94ede66ce07a03bf2244af0
parent206a00915b350fdb5f0fd9dd6107e743b6338612 (diff)
Notify preprocessors of the mdbook version and add __non_exhaustive elementsversion
-rw-r--r--src/preprocess/mod.rs11
-rw-r--r--src/renderer/mod.rs2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/preprocess/mod.rs b/src/preprocess/mod.rs
index 5f59c5bf..87a135db 100644
--- a/src/preprocess/mod.rs
+++ b/src/preprocess/mod.rs
@@ -21,12 +21,21 @@ pub struct PreprocessorContext {
pub config: Config,
/// The `Renderer` this preprocessor is being used with.
pub renderer: String,
+ /// The calling `mdbook` version.
+ pub mdbook_version: String,
+ __non_exhaustive: (),
}
impl PreprocessorContext {
/// Create a new `PreprocessorContext`.
pub(crate) fn new(root: PathBuf, config: Config, renderer: String) -> Self {
- PreprocessorContext { root, config, renderer }
+ PreprocessorContext {
+ root,
+ config,
+ renderer,
+ mdbook_version: ::MDBOOK_VERSION.to_string(),
+ __non_exhaustive: (),
+ }
}
}
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index 78d208e2..41176ae0 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -64,6 +64,7 @@ pub struct RenderContext {
/// renderers to cache intermediate results, this directory is not
/// guaranteed to be empty or even exist.
pub destination: PathBuf,
+ __non_exhaustive: (),
}
impl RenderContext {
@@ -79,6 +80,7 @@ impl RenderContext {
version: ::MDBOOK_VERSION.to_string(),
root: root.into(),
destination: destination.into(),
+ __non_exhaustive: (),
}
}