summaryrefslogtreecommitdiffstats
path: root/lib/book.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-28 11:43:44 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-28 11:43:44 +0100
commit324fbb2f695a7efb012eb04e1184248cae960587 (patch)
tree516261eca635fe9eaa5563648e660c5538b4042c /lib/book.js
parent5539ab48a5e4cc5a94c692f62f2e9dc55d6a4e49 (diff)
downloadgitbook-324fbb2f695a7efb012eb04e1184248cae960587.zip
gitbook-324fbb2f695a7efb012eb04e1184248cae960587.tar.gz
gitbook-324fbb2f695a7efb012eb04e1184248cae960587.tar.bz2
Convert svg images to png in ebook
Diffstat (limited to 'lib/book.js')
-rw-r--r--lib/book.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/book.js b/lib/book.js
index cadc9f5..4e4279a 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -456,6 +456,9 @@ Book.prototype.parseGlossary = function() {
Book.prototype.parsePage = function(filename, options) {
var that = this, page = {};
options = _.defaults(options || {}, {
+ // Transform svg images
+ convertImages: false,
+
// Interpolate before templating
interpolateTemplate: _.identity,
@@ -514,14 +517,20 @@ Book.prototype.parsePage = function(filename, options) {
// Prepare html
.then(function(_page) {
- page.sections = pageUtil.normalize(_page.sections, {
+ return pageUtil.normalize(_page.sections, {
+ book: that,
+ convertImages: options.convertImages,
input: filename,
navigation: that.navigation,
base: path.dirname(filename) || './',
output: path.dirname(filename) || './',
glossary: that.glossary
});
+ })
+ // Interpolate output
+ .then(function(_sections) {
+ page.sections = _sections;
return interpolate(options.interpolateContent);
})