diff options
Diffstat (limited to 'js/lib/index.js')
-rwxr-xr-x | js/lib/index.js | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/js/lib/index.js b/js/lib/index.js index d0532c6..22a2184 100755 --- a/js/lib/index.js +++ b/js/lib/index.js @@ -13,11 +13,15 @@ var util = require('util'); -var renderAST = function(tree) { - return util.inspect(tree.toAST(), {depth: 20}) + '\n'; -}; - module.exports.Node = require('./node'); module.exports.DocParser = require('./blocks'); module.exports.HtmlRenderer = require('./html'); -module.exports.ASTRenderer = renderAST; +module.exports.ASTRenderer = function(options) { + return { + render: function(tree) { + return util.inspect(tree.toAST(), null, 20, + this.options.colors) + '\n'; + }, + options: options || {} + }; +} |