summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-10-13 10:41:23 +0200
committerSamy Pessé <samypesse@gmail.com>2014-10-13 10:41:23 +0200
commit1da341741b4e5f2cee3bb60fbd3b546708e2ef82 (patch)
treeb047aaca8c26f1316b2f9b4d20b6f1541d34ad67 /lib
parent6ea5b2b539b107fff094689d0844e661e3260130 (diff)
parent2dd6192576fe2602d11741c5a9fc17c27ac1ddc3 (diff)
downloadgitbook-1da341741b4e5f2cee3bb60fbd3b546708e2ef82.zip
gitbook-1da341741b4e5f2cee3bb60fbd3b546708e2ef82.tar.gz
gitbook-1da341741b4e5f2cee3bb60fbd3b546708e2ef82.tar.bz2
Merge pull request #471 from GitbookIO/feature/multipages
Use multiple HTML files for ebook generation
Diffstat (limited to 'lib')
-rw-r--r--lib/generate/ebook/index.js3
-rw-r--r--lib/generate/generator.js4
-rw-r--r--lib/generate/json/index.js2
-rw-r--r--lib/generate/page/index.js35
-rw-r--r--lib/generate/plugin.js2
-rw-r--r--lib/generate/site/glossary_indexer.js1
6 files changed, 11 insertions, 36 deletions
diff --git a/lib/generate/ebook/index.js b/lib/generate/ebook/index.js
index 369b974..b7a4119 100644
--- a/lib/generate/ebook/index.js
+++ b/lib/generate/ebook/index.js
@@ -41,7 +41,8 @@ Generator.prototype.finish = function() {
"--level1-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]",
"--level2-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]",
"--level3-toc": "descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]",
- "--no-chapters-in-toc": true
+ "--no-chapters-in-toc": true,
+ "--max-levels": "1000"
};
if (format == "pdf") {
diff --git a/lib/generate/generator.js b/lib/generate/generator.js
index 5367b8b..8724a4f 100644
--- a/lib/generate/generator.js
+++ b/lib/generate/generator.js
@@ -79,6 +79,4 @@ BaseGenerator.prototype.finish = function() {
return Q.reject(new Error("Could not finish generation"));
};
-
-
-module.exports = BaseGenerator; \ No newline at end of file
+module.exports = BaseGenerator;
diff --git a/lib/generate/json/index.js b/lib/generate/json/index.js
index 6a68f68..6bc5211 100644
--- a/lib/generate/json/index.js
+++ b/lib/generate/json/index.js
@@ -73,4 +73,4 @@ Generator.prototype.finish = function() {
// ignore
};
-module.exports = Generator; \ No newline at end of file
+module.exports = Generator;
diff --git a/lib/generate/page/index.js b/lib/generate/page/index.js
index 9e48a5e..4a639ba 100644
--- a/lib/generate/page/index.js
+++ b/lib/generate/page/index.js
@@ -30,24 +30,6 @@ Generator.prototype.loadTemplates = function() {
);
};
-Generator.prototype.convertFile = function(content, input) {
- var that = this;
- var json = {
- path: input,
- progress: parse.progress(this.options.navigation, input)
- };
-
- return this.prepareFile(content, input)
- .then(function(page) {
- that.pages[input] = page;
- });
-};
-
-// Generate languages index
-Generator.prototype.langsIndex = function(langs) {
- return Q();
-};
-
Generator.prototype.finish = function() {
var that = this;
var basePath = ".";
@@ -56,16 +38,6 @@ Generator.prototype.finish = function() {
var progress = parse.progress(this.options.navigation, "README.md");
return Q()
- // Generate html
- .then(function(pages) {
- return that._writeTemplate(that.template, {
- pages: that.pages,
- progress: progress,
-
- basePath: basePath,
- staticBase: path.join(basePath, "gitbook"),
- }, output);
- })
// Copy cover
.then(function() {
@@ -78,4 +50,9 @@ Generator.prototype.finish = function() {
});
};
-module.exports = Generator; \ No newline at end of file
+// Generate languages index
+Generator.prototype.langsIndex = function(langs) {
+ return Q();
+};
+
+module.exports = Generator;
diff --git a/lib/generate/plugin.js b/lib/generate/plugin.js
index e699a26..9d740a5 100644
--- a/lib/generate/plugin.js
+++ b/lib/generate/plugin.js
@@ -8,7 +8,7 @@ var resolve = require('resolve');
var pkg = require("../../package.json");
-var RESOURCES = ["js", "css"];
+var RESOURCES = ["js", "css"];
var Plugin = function(name, root, generator) {
this.name = name;
diff --git a/lib/generate/site/glossary_indexer.js b/lib/generate/site/glossary_indexer.js
index dc9c2d8..46ac9a4 100644
--- a/lib/generate/site/glossary_indexer.js
+++ b/lib/generate/site/glossary_indexer.js
@@ -1,5 +1,4 @@
var _ = require("lodash");
-
var kramed = require('kramed');
var textRenderer = require('kramed-text-renderer');