diff options
Diffstat (limited to 'lib/output')
-rw-r--r-- | lib/output/base.js | 13 | ||||
-rw-r--r-- | lib/output/conrefs.js | 22 | ||||
-rw-r--r-- | lib/output/website/index.js | 2 |
3 files changed, 35 insertions, 2 deletions
diff --git a/lib/output/base.js b/lib/output/base.js index 853fa30..8142761 100644 --- a/lib/output/base.js +++ b/lib/output/base.js @@ -3,6 +3,7 @@ var Ignore = require('ignore'); var Promise = require('../utils/promise'); var PluginsManager = require('../plugins'); +var TemplateEngine = require('../template'); /* Output is like a stream interface for a parsed book @@ -11,15 +12,18 @@ to output "something". The process is mostly on the behavior of "onPage" and "onAsset" */ -function Output(book, type) { +function Output(book) { _.bindAll(this); this.book = book; this.log = this.book.log; - this.type = type; + // Create plugins manager this.plugins = new PluginsManager(book); + // Create template engine + this.template = new TemplateEngine(this); + // Files to ignore in output this.ignore = Ignore(); this.ignore.addPattern(_.compact([ @@ -130,6 +134,11 @@ Output.prototype.onOutputImage = function(page, imgFile) { return page.relative(imgFile); }; +// By default don;t resolve conrefs +Output.prototype.onResolveTemplate = function(from, to) { + +}; + // Finish the generation Output.prototype.finish = function() { diff --git a/lib/output/conrefs.js b/lib/output/conrefs.js new file mode 100644 index 0000000..2883c7b --- /dev/null +++ b/lib/output/conrefs.js @@ -0,0 +1,22 @@ +var util = require('util'); + +var Output = require('./base'); +var Git = require('../utils/git'); +var pathUtil = require('../utils/path'); + +/* +Middleware for output to resolve git conrefs +*/ + +function ConrefsLoader() { + Output.apply(this, arguments); + this.git = new Git(); +} +util.inherits(ConrefsLoader, Output); + +// Resolve an include in the template engine +ConrefsLoader.prototype.onResolveTemplate = function(from, to) { + +}; + +module.exports = ConrefsLoader; diff --git a/lib/output/website/index.js b/lib/output/website/index.js index e60dae2..a35cafe 100644 --- a/lib/output/website/index.js +++ b/lib/output/website/index.js @@ -1,6 +1,8 @@ var util = require('util'); var FolderOutput = require('../base'); +var Theme = require('./theme'); + function WebsiteOutput() { FolderOutput.apply(this, arguments); } |