diff options
Diffstat (limited to 'lib/generators')
-rw-r--r-- | lib/generators/base.js | 29 | ||||
-rw-r--r-- | lib/generators/index.js | 10 | ||||
-rw-r--r-- | lib/generators/json.js | 14 |
3 files changed, 53 insertions, 0 deletions
diff --git a/lib/generators/base.js b/lib/generators/base.js new file mode 100644 index 0000000..554a389 --- /dev/null +++ b/lib/generators/base.js @@ -0,0 +1,29 @@ + +function Generator(output, type) { + this.output = output; + this.book = output.book; + this.type = type; +} + +// Prepare the generation +Generator.prototype.prepare = function() { + +}; + +// Copy an asset file (non-parsable), ex: images, etc +Generator.prototype.writeFile = function(filename) { + +}; + +// Write a page (parsable file), ex: markdown, etc +Generator.prototype.writePage = function(page) { + +}; + +// Finish the generation +Generator.prototype.finish = function() { + +}; + + +module.exports = Generator; diff --git a/lib/generators/index.js b/lib/generators/index.js new file mode 100644 index 0000000..de8a1e6 --- /dev/null +++ b/lib/generators/index.js @@ -0,0 +1,10 @@ +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/generators/json.js b/lib/generators/json.js new file mode 100644 index 0000000..c5a87fe --- /dev/null +++ b/lib/generators/json.js @@ -0,0 +1,14 @@ +var util = require('util'); +var Generator = require('./base'); + +function JSONGenerator() { + Generator.apply(this, arguments); +} +util.inherits(JSONGenerator, Generator); + + + + + + +module.exports = JSONGenerator; |