2025-07-21 18:06:49 -07:00
|
|
|
//! mdBook HTML renderer.
|
2025-07-21 18:32:36 -07:00
|
|
|
|
2025-07-21 20:45:14 -07:00
|
|
|
mod html_handlebars;
|
2025-07-21 18:32:36 -07:00
|
|
|
pub mod theme;
|
2025-07-21 20:45:14 -07:00
|
|
|
|
|
|
|
|
pub use html_handlebars::HtmlHandlebars;
|
2025-08-22 16:17:41 -07:00
|
|
|
use mdbook_core::config::HtmlConfig;
|
|
|
|
|
use mdbook_markdown::HtmlRenderOptions;
|
|
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
|
|
/// Creates an [`HtmlRenderOptions`] from the given config.
|
|
|
|
|
pub fn html_render_options_from_config<'a>(
|
|
|
|
|
path: &'a Path,
|
|
|
|
|
config: &HtmlConfig,
|
|
|
|
|
) -> HtmlRenderOptions<'a> {
|
|
|
|
|
let mut options = HtmlRenderOptions::new(path);
|
|
|
|
|
options.markdown_options.smart_punctuation = config.smart_punctuation;
|
|
|
|
|
options
|
|
|
|
|
}
|