From f3f6b40ea91984fd4c152aa03451de75121f0b0b Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Mon, 3 Jul 2017 23:18:27 +0200 Subject: [PATCH] Moved playpen.rs `renderer` helper to `preprocess/links.rs` module --- src/lib.rs | 1 + .../html_handlebars/helpers/playpen.rs => preprocess/links.rs} | 0 src/preprocess/mod.rs | 1 + src/renderer/html_handlebars/hbs_renderer.rs | 3 ++- src/renderer/html_handlebars/helpers/mod.rs | 1 - 5 files changed, 4 insertions(+), 2 deletions(-) rename src/{renderer/html_handlebars/helpers/playpen.rs => preprocess/links.rs} (100%) create mode 100644 src/preprocess/mod.rs diff --git a/src/lib.rs b/src/lib.rs index b4757c54..897768c5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -86,6 +86,7 @@ extern crate log; pub mod book; pub mod config; mod parse; +mod preprocess; pub mod renderer; pub mod theme; pub mod utils; diff --git a/src/renderer/html_handlebars/helpers/playpen.rs b/src/preprocess/links.rs similarity index 100% rename from src/renderer/html_handlebars/helpers/playpen.rs rename to src/preprocess/links.rs diff --git a/src/preprocess/mod.rs b/src/preprocess/mod.rs new file mode 100644 index 00000000..19b2f4d4 --- /dev/null +++ b/src/preprocess/mod.rs @@ -0,0 +1 @@ +pub mod links; diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index b1ba47ca..321fcc87 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -1,4 +1,5 @@ use renderer::html_handlebars::helpers; +use preprocess; use renderer::Renderer; use book::MDBook; use book::bookitem::{BookItem, Chapter}; @@ -46,7 +47,7 @@ impl HtmlHandlebars { // Parse for playpen links if let Some(p) = path.parent() { - content = helpers::playpen::render_playpen(&content, p); + content = preprocess::links::render_playpen(&content, p); } content = utils::render_markdown(&content, ctx.book.get_curly_quotes()); diff --git a/src/renderer/html_handlebars/helpers/mod.rs b/src/renderer/html_handlebars/helpers/mod.rs index 2fc287c2..62fc6149 100644 --- a/src/renderer/html_handlebars/helpers/mod.rs +++ b/src/renderer/html_handlebars/helpers/mod.rs @@ -1,3 +1,2 @@ pub mod navigation; pub mod toc; -pub mod playpen;