Skip to content

Commit c803270

Browse files
committed
Add option pdf.pageNumber
Fix GitbookIO/editor#38
1 parent 5d51263 commit c803270

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ Here are the options that can be stored in this file:
106106
// Add toc at the end of the file
107107
"toc": true,
108108

109+
// Add page numbers to the bottom of every page
110+
"pageNumbers": false,
111+
109112
// Font size for the fiel content
110113
"fontSize": 12,
111114

lib/generate/ebook/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Generator.prototype.finish = function() {
4444
var pdfOptions = _.defaults(that.options.pdf || {}, {
4545
"fontSize": 12,
4646
"toc": true,
47+
"pageNumbers": false,
4748
"paperSize": "a4",
4849
"margin": {
4950
"right": 62,
@@ -61,6 +62,7 @@ Generator.prototype.finish = function() {
6162
"--pdf-add-toc": Boolean(pdfOptions.toc),
6263
"--pdf-default-font-size": String(pdfOptions.fontSize),
6364
"--paper-size": String(pdfOptions.paperSize),
65+
"--pdf-page-numbers": Boolean(pdfOptions.pageNumbers)
6466
});
6567
}
6668

lib/utils/string.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function escapeShellArg(arg) {
1111
function optionsToShellArgs(options) {
1212
return _.chain(options)
1313
.map(function(value, key) {
14-
if (value == null) return null;
14+
if (value == null || value == false) return null;
1515
if (value == true) return key;
1616
return key+"="+escapeShellArg(value);
1717
})

0 commit comments

Comments
 (0)