mirror of
https://github.com/rust-lang/mdBook.git
synced 2025-12-28 15:01:45 -05:00
Compare commits
8 Commits
version
...
smart-prep
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a00ccf8c72 | ||
|
|
18a36ec1fa | ||
|
|
40ede19103 | ||
|
|
4d7027f8a7 | ||
|
|
d0a6d7c87c | ||
|
|
995efc22d5 | ||
|
|
a0702037bd | ||
|
|
769fd94868 |
@@ -114,12 +114,6 @@ pub mod renderer;
|
|||||||
pub mod theme;
|
pub mod theme;
|
||||||
pub mod utils;
|
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::BookItem;
|
||||||
pub use book::MDBook;
|
pub use book::MDBook;
|
||||||
pub use config::Config;
|
pub use config::Config;
|
||||||
|
|||||||
@@ -21,21 +21,12 @@ 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 {
|
PreprocessorContext { root, config, renderer }
|
||||||
root,
|
|
||||||
config,
|
|
||||||
renderer,
|
|
||||||
mdbook_version: ::MDBOOK_VERSION.to_string(),
|
|
||||||
__non_exhaustive: (),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ use book::Book;
|
|||||||
use config::Config;
|
use config::Config;
|
||||||
use errors::*;
|
use errors::*;
|
||||||
|
|
||||||
|
const MDBOOK_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
||||||
/// An arbitrary `mdbook` backend.
|
/// An arbitrary `mdbook` backend.
|
||||||
///
|
///
|
||||||
/// Although it's quite possible for you to import `mdbook` as a library and
|
/// Although it's quite possible for you to import `mdbook` as a library and
|
||||||
@@ -64,7 +66,6 @@ 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 {
|
||||||
@@ -77,10 +78,9 @@ impl RenderContext {
|
|||||||
RenderContext {
|
RenderContext {
|
||||||
book: book,
|
book: book,
|
||||||
config: config,
|
config: config,
|
||||||
version: ::MDBOOK_VERSION.to_string(),
|
version: MDBOOK_VERSION.to_string(),
|
||||||
root: root.into(),
|
root: root.into(),
|
||||||
destination: destination.into(),
|
destination: destination.into(),
|
||||||
__non_exhaustive: (),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<!-- Custom theme stylesheets -->
|
<!-- Custom theme stylesheets -->
|
||||||
{{#each additional_css}}
|
{{#each additional_css}}
|
||||||
<link rel="stylesheet" href="{{ ../path_to_root }}{{ this }}">
|
<link rel="stylesheet" href="{{ this }}">
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#if mathjax_support}}
|
{{#if mathjax_support}}
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
|
|
||||||
<!-- Custom JS scripts -->
|
<!-- Custom JS scripts -->
|
||||||
{{#each additional_js}}
|
{{#each additional_js}}
|
||||||
<script type="text/javascript" src="{{ ../path_to_root }}{{this}}"></script>
|
<script type="text/javascript" src="{{ path_to_root }}{{this}}"></script>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#if is_print}}
|
{{#if is_print}}
|
||||||
|
|||||||
Reference in New Issue
Block a user