summaryrefslogtreecommitdiffstats
path: root/lib/output
diff options
context:
space:
mode:
Diffstat (limited to 'lib/output')
-rw-r--r--lib/output/ebook/getPDFTemplate.js4
-rw-r--r--lib/output/ebook/onFinish.js4
-rw-r--r--lib/output/generatePage.js14
-rw-r--r--lib/output/website/onFinish.js4
-rw-r--r--lib/output/website/onPage.js4
5 files changed, 18 insertions, 12 deletions
diff --git a/lib/output/ebook/getPDFTemplate.js b/lib/output/ebook/getPDFTemplate.js
index f7a450d..354cc29 100644
--- a/lib/output/ebook/getPDFTemplate.js
+++ b/lib/output/ebook/getPDFTemplate.js
@@ -30,8 +30,8 @@ function getPDFTemplate(output, type) {
return Templating.renderFile(engine, 'ebook/' + filePath, context)
// Inline css and assets
- .then(function(html) {
- return Promise.nfcall(juice.juiceResources, html, {
+ .then(function(tplOut) {
+ return Promise.nfcall(juice.juiceResources, tplOut.getContent(), {
webResources: {
relativeTo: outputRoot
}
diff --git a/lib/output/ebook/onFinish.js b/lib/output/ebook/onFinish.js
index f365bcb..7f21548 100644
--- a/lib/output/ebook/onFinish.js
+++ b/lib/output/ebook/onFinish.js
@@ -29,8 +29,8 @@ function writeSummary(output) {
return Templating.renderFile(engine, prefix + '/summary.html', context)
// Write it to the disk
- .then(function(html) {
- return writeFile(output, filePath, html);
+ .then(function(tplOut) {
+ return writeFile(output, filePath, tplOut.getContent());
});
}
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
diff --git a/lib/output/website/onFinish.js b/lib/output/website/onFinish.js
index e3560e2..5267458 100644
--- a/lib/output/website/onFinish.js
+++ b/lib/output/website/onFinish.js
@@ -27,8 +27,8 @@ function onFinish(output) {
return Templating.renderFile(engine, prefix + '/languages.html', context)
// Write it to the disk
- .then(function(html) {
- return writeFile(output, filePath, html);
+ .then(function(tplOut) {
+ return writeFile(output, filePath, tplOut.getContent());
});
}
diff --git a/lib/output/website/onPage.js b/lib/output/website/onPage.js
index 16a5c39..14c7b22 100644
--- a/lib/output/website/onPage.js
+++ b/lib/output/website/onPage.js
@@ -67,8 +67,8 @@ function onPage(output, page) {
return Templating.renderFile(engine, prefix + '/page.html', context)
// Write it to the disk
- .then(function(html) {
- return writeFile(output, filePath, html);
+ .then(function(tplOut) {
+ return writeFile(output, filePath, tplOut.getContent());
});
});
}