diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/book.js | 7 | ||||
-rw-r--r-- | lib/generators/website.js | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js index 650931f..6cdc3e6 100644 --- a/lib/book.js +++ b/lib/book.js @@ -10,6 +10,7 @@ var fs = require("./utils/fs"); var parseNavigation = require("./utils/navigation"); var parseProgress = require("./utils/progress"); var pageUtil = require("./utils/page"); +var batch = require("./utils/batch"); var links = require("./utils/links"); var logger = require("./utils/logger"); @@ -224,9 +225,11 @@ Book.prototype.generate = function(generator) { // Finally let's generate content .then(function() { - return _.reduce(ops["content"] || [], function(prev, file) { + var nFiles = (ops["content"] || []).length; + return _.reduce(ops["content"] || [], function(prev, file, i) { return prev.then(function() { - that.log.debug.ln("converting", file); + var p = ((i*100)/nFiles).toFixed(0)+"%"; + that.log.info.ln("processing", file, p); return Q(generator.convertFile(file)); }); }, Q()); diff --git a/lib/generators/website.js b/lib/generators/website.js index d40ffa8..a58e3c4 100644 --- a/lib/generators/website.js +++ b/lib/generators/website.js @@ -142,7 +142,7 @@ Generator.prototype.convertFile = function(input) { var basePath = path.relative(path.dirname(output), that.options.output) || "."; if (process.platform === 'win32') basePath = basePath.replace(/\\/g, '/'); - that.book.log.info.ln("write parsed file", page.path, "to", relativeOutput); + that.book.log.debug.ln("write parsed file", page.path, "to", relativeOutput); return that._writeTemplate(that.templates["page"], { progress: page.progress, |