Notify preprocessors of the mdbook version and add __non_exhaustive elements
This commit is contained in:
parent
206a00915b
commit
5dce539928
|
@ -21,12 +21,21 @@ pub struct PreprocessorContext {
|
||||||
pub config: Config,
|
pub config: Config,
|
||||||
/// The `Renderer` this preprocessor is being used with.
|
/// The `Renderer` this preprocessor is being used with.
|
||||||
pub renderer: String,
|
pub renderer: String,
|
||||||
|
/// The calling `mdbook` version.
|
||||||
|
pub mdbook_version: String,
|
||||||
|
__non_exhaustive: (),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PreprocessorContext {
|
impl PreprocessorContext {
|
||||||
/// Create a new `PreprocessorContext`.
|
/// Create a new `PreprocessorContext`.
|
||||||
pub(crate) fn new(root: PathBuf, config: Config, renderer: String) -> Self {
|
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: (),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ pub struct RenderContext {
|
||||||
/// renderers to cache intermediate results, this directory is not
|
/// renderers to cache intermediate results, this directory is not
|
||||||
/// guaranteed to be empty or even exist.
|
/// guaranteed to be empty or even exist.
|
||||||
pub destination: PathBuf,
|
pub destination: PathBuf,
|
||||||
|
__non_exhaustive: (),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RenderContext {
|
impl RenderContext {
|
||||||
|
@ -79,6 +80,7 @@ impl RenderContext {
|
||||||
version: ::MDBOOK_VERSION.to_string(),
|
version: ::MDBOOK_VERSION.to_string(),
|
||||||
root: root.into(),
|
root: root.into(),
|
||||||
destination: destination.into(),
|
destination: destination.into(),
|
||||||
|
__non_exhaustive: (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue