diff options
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/book.js b/lib/book.js index 50ef252..991e126 100644 --- a/lib/book.js +++ b/lib/book.js @@ -22,10 +22,10 @@ var Book = function(root, options) { this.summary = {}; // Glossary - this.glossary = {}; + this.glossary = []; // Langs - this.langs = {}; + this.langs = []; }; // Initialize and parse the book: config, summary, glossary @@ -38,10 +38,10 @@ Book.prototype.init = function() { .then(function() { return that.parseLangs() .then(function() { - multilingal = that.langs.list.length > 0; + multilingal = that.langs.length > 0; // Sub-books that inherit from the current book configuration - that.books = _.map(that.langs.list, function(lang) { + that.books = _.map(that.langs, function(lang) { return new Book( path.join(that.root, lang.path), _.extend({}, that.options, { @@ -63,13 +63,23 @@ Book.prototype.init = function() { .thenResolve(this); }; +// Generate the output +Book.prototype.generate = function() { + var that = this; + + return this.init() + .then(function() { + + }); +}; + // Parse langs Book.prototype.parseLangs = function() { var that = this; return that.findFile("LANGS") .then(function(langs) { - if (!langs) return {}; + if (!langs) return []; return that.readFile(langs.path) .then(function(content) { |