diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-05-05 11:00:05 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-05-05 11:00:05 +0200 |
commit | 34947b5e207e84ef43a8194c0ec7bac19dccf709 (patch) | |
tree | 06e687700d95590cae678f8bef381e8a62dc0129 /lib/output/generatePage.js | |
parent | c621380b664bcbef087df571b662e7a34e098168 (diff) | |
download | gitbook-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.js | 14 |
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 |