summaryrefslogtreecommitdiffstats
path: root/lib/output
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-04-25 13:52:56 +0200
committerSamy Pessé <samypesse@gmail.com>2016-04-25 13:52:56 +0200
commit4aed2cf65240abb26384d7d86ccb27b171e6bb9a (patch)
tree949ede45c93c37215c44bd1b190248d7669501b0 /lib/output
parent244fb0ca28f29ac429f58e0e885d21cc6c40beba (diff)
downloadgitbook-4aed2cf65240abb26384d7d86ccb27b171e6bb9a.zip
gitbook-4aed2cf65240abb26384d7d86ccb27b171e6bb9a.tar.gz
gitbook-4aed2cf65240abb26384d7d86ccb27b171e6bb9a.tar.bz2
Add post processing for templates
Diffstat (limited to 'lib/output')
-rw-r--r--lib/output/generatePage.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/output/generatePage.js b/lib/output/generatePage.js
index 4507f2e..113bf22 100644
--- a/lib/output/generatePage.js
+++ b/lib/output/generatePage.js
@@ -14,6 +14,7 @@ var createTemplateEngine = require('./createTemplateEngine');
*/
function generatePage(output, page) {
var book = output.getBook();
+ var engine = createTemplateEngine(output);
return Parse.parsePage(book, page)
.then(function(resultPage) {
@@ -34,13 +35,17 @@ function generatePage(output, page) {
// Render templating syntax
.then(function(content) {
- var engine = createTemplateEngine(output);
return Templating.render(engine, filePath, content);
})
// Render page using parser (markdown -> HTML)
.then(parser.page).get('content')
+ // Post processing for templating syntax
+ .then(function(content) {
+ return Templating.postRender(engine, content);
+ })
+
// Return new page
.then(function(content) {
return resultPage.set('content', content);