diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config/default.js | 2 | ||||
-rw-r--r-- | lib/config/index.js | 6 | ||||
-rw-r--r-- | lib/output/index.js | 10 | ||||
-rw-r--r-- | lib/template/index.js | 14 |
4 files changed, 7 insertions, 25 deletions
diff --git a/lib/config/default.js b/lib/config/default.js index 1695e11..23a92f9 100644 --- a/lib/config/default.js +++ b/lib/config/default.js @@ -1,5 +1,3 @@ -var path = require('path'); - module.exports = { // Book metadatas (somes are extracted from the README by default) 'title': null, diff --git a/lib/config/index.js b/lib/config/index.js index a5a0d67..34bf97c 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -62,12 +62,6 @@ Config.prototype.load = function() { that.options.plugins = _.union(that.options.plugins, that.options.defaultsPlugins); that.options.plugins = _.uniq(that.options.plugins, 'name'); - // Default value for text direction (from language) - /*if (!that.options.direction) { - var lang = i18n.getCatalog(that.options.language); - if (lang) that.options.direction = lang.direction; - }*/ - that.options.gitbook = gitbook.version; }); }; diff --git a/lib/output/index.js b/lib/output/index.js deleted file mode 100644 index dcb2ffe..0000000 --- a/lib/output/index.js +++ /dev/null @@ -1,10 +0,0 @@ -var _ = require('lodash'); -//var EbookGenerator = require('./ebook'); - -module.exports = { - json: require('./json'), - /*website: require('./website'), - pdf: _.partialRight(EbookGenerator, 'pdf'), - mobi: _.partialRight(EbookGenerator, 'mobi'), - epub: _.partialRight(EbookGenerator, 'epub')*/ -}; diff --git a/lib/template/index.js b/lib/template/index.js index bb8272c..d426988 100644 --- a/lib/template/index.js +++ b/lib/template/index.js @@ -176,7 +176,7 @@ TemplateEngine.prototype.addBlock = function(name, block) { var args = parser.parseSignature(null, true); parser.advanceAfterBlockEnd(tok.value); - while (1) { + do { // Read body var currentBody = parser.parseUntilBlocks.apply(parser, allBlocks); @@ -193,14 +193,14 @@ TemplateEngine.prototype.addBlock = function(name, block) { // Read new block lastBlockName = parser.peekToken().value; - if (lastBlockName == block.end) { - break; - } // Parse signature and move to the end of the block - lastBlockArgs = parser.parseSignature(null, true); - parser.advanceAfterBlockEnd(lastBlockName); - } + if (lastBlockName != block.end) { + lastBlockArgs = parser.parseSignature(null, true); + parser.advanceAfterBlockEnd(lastBlockName); + } + } while (lastBlockName == block.end) + parser.advanceAfterBlockEnd(); var bodies = [body]; |