summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-02-12 12:47:08 +0100
committerSamy Pessé <samypesse@gmail.com>2015-02-12 12:47:08 +0100
commit843889303e3fd4fca9c0ef9532e68936952bfc6c (patch)
treeeea5f01442f935af8668d81bde46be1c00c0c39a /lib
parent4ad2b040b462ae2f94922e9ad01d7804eb6d79dc (diff)
downloadgitbook-843889303e3fd4fca9c0ef9532e68936952bfc6c.zip
gitbook-843889303e3fd4fca9c0ef9532e68936952bfc6c.tar.gz
gitbook-843889303e3fd4fca9c0ef9532e68936952bfc6c.tar.bz2
Improve pdf by adding default header and footer
Diffstat (limited to 'lib')
-rw-r--r--lib/configuration.js4
-rw-r--r--lib/generators/ebook.js4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/configuration.js b/lib/configuration.js
index bedf266..7316dd8 100644
--- a/lib/configuration.js
+++ b/lib/configuration.js
@@ -220,8 +220,8 @@ Configuration.DEFAULT = {
"margin": {
"right": 62,
"left": 62,
- "top": 36,
- "bottom": 36
+ "top": 56,
+ "bottom": 56
},
//Header HTML template. Available variables: _PAGENUM_, _TITLE_, _AUTHOR_ and _SECTION_.
diff --git a/lib/generators/ebook.js b/lib/generators/ebook.js
index ebffa79..09215c4 100644
--- a/lib/generators/ebook.js
+++ b/lib/generators/ebook.js
@@ -87,8 +87,8 @@ Generator.prototype.finish = function() {
"--pdf-mono-font-size": String(pdfOptions.fontSize),
"--paper-size": String(pdfOptions.paperSize),
"--pdf-page-numbers": Boolean(pdfOptions.pageNumbers),
- "--pdf-header-template": String(pdfOptions.headerTemplate),
- "--pdf-footer-template": String(pdfOptions.footerTemplate)
+ "--pdf-header-template": String(pdfOptions.headerTemplate) || "<p class='header'><span>"+that.options.title+"</span></p>",
+ "--pdf-footer-template": String(pdfOptions.footerTemplate) || "<p class='footer'><span>_SECTION_</span> <span style='float:right;'>_PAGENUM_</span></p>"
});
}