diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-02-12 12:47:08 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-02-12 12:47:08 +0100 |
commit | 843889303e3fd4fca9c0ef9532e68936952bfc6c (patch) | |
tree | eea5f01442f935af8668d81bde46be1c00c0c39a | |
parent | 4ad2b040b462ae2f94922e9ad01d7804eb6d79dc (diff) | |
download | gitbook-843889303e3fd4fca9c0ef9532e68936952bfc6c.zip gitbook-843889303e3fd4fca9c0ef9532e68936952bfc6c.tar.gz gitbook-843889303e3fd4fca9c0ef9532e68936952bfc6c.tar.bz2 |
Improve pdf by adding default header and footer
-rw-r--r-- | lib/configuration.js | 4 | ||||
-rw-r--r-- | lib/generators/ebook.js | 4 | ||||
-rwxr-xr-x | theme/stylesheets/ebook.less | 38 |
3 files changed, 4 insertions, 42 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>" }); } diff --git a/theme/stylesheets/ebook.less b/theme/stylesheets/ebook.less index 46fe4bd..5f47ece 100755 --- a/theme/stylesheets/ebook.less +++ b/theme/stylesheets/ebook.less @@ -13,44 +13,6 @@ .book-chapter { display: none; } - - .exercise, .quiz { - margin: 1cm 0cm; - border: 2px solid #ddd; - - .exercise-header { - padding: 0.1cm 0.3cm; - background: #f5f5f5; - border-bottom: 1px solid #ddd; - font-weight: bold; - page-break-inside: avoid; - } - - .exercise-inner { - padding: 0.15cm 0.3cm; - - p:last-child { - margin: 0px; - } - } - - hr { - height: 2px; - } - - .question { - margin-top: 0.1cm; - border-top: 1px solid #ddd; - - .question-base { - - } - - .question-solution { - - } - } - } } |