summaryrefslogtreecommitdiffstats
path: root/lib/output/generatePage.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-05-05 11:00:05 +0200
committerSamy Pesse <samypesse@gmail.com>2016-05-05 11:00:05 +0200
commit34947b5e207e84ef43a8194c0ec7bac19dccf709 (patch)
tree06e687700d95590cae678f8bef381e8a62dc0129 /lib/output/generatePage.js
parentc621380b664bcbef087df571b662e7a34e098168 (diff)
downloadgitbook-34947b5e207e84ef43a8194c0ec7bac19dccf709.zip
gitbook-34947b5e207e84ef43a8194c0ec7bac19dccf709.tar.gz
gitbook-34947b5e207e84ef43a8194c0ec7bac19dccf709.tar.bz2
Add mode TemplateOutput to represent {content + blocks} from template
Diffstat (limited to 'lib/output/generatePage.js')
-rw-r--r--lib/output/generatePage.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/output/generatePage.js b/lib/output/generatePage.js
index 27b4eb1..7e4e454 100644
--- a/lib/output/generatePage.js
+++ b/lib/output/generatePage.js
@@ -47,12 +47,18 @@ function generatePage(output, page) {
return Templating.render(engine, filePath, content, context);
})
- // Render page using parser (markdown -> HTML)
- .then(parser.parsePage.bind(parser)).get('content')
+ .then(function(output) {
+ var content = output.getContent();
+
+ return parser.parsePage(content)
+ .then(function(result) {
+ return output.setContent(result.content);
+ });
+ })
// Post processing for templating syntax
- .then(function(content) {
- return Templating.postRender(engine, content);
+ .then(function(output) {
+ return Templating.postRender(engine, output);
})
// Return new page