diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-10-18 17:58:24 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-10-18 18:26:37 -0700 |
commit | 2e01c72a7c4bd2d2eb0a91bed41daa45f0708587 (patch) | |
tree | 0aee8a55a7b36b315647e288ed91a8fbfde5b7ff /js/lib/index.js | |
parent | 6fa280c2f430e68f5857b314b9607007be6245ca (diff) |
Added renderAST to js, added AST render tab to dingus.
Modified processInlines so it creates new objects instead
of modifying in place. This way we can remove the extraneous
fields only needed for parsing.
Diffstat (limited to 'js/lib/index.js')
-rwxr-xr-x | js/lib/index.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/lib/index.js b/js/lib/index.js index a8bf009..cfb8bf9 100755 --- a/js/lib/index.js +++ b/js/lib/index.js @@ -9,5 +9,12 @@ // var renderer = new stmd.HtmlRenderer(); // console.log(renderer.render(parser.parse('Hello *world*'))); +var util = require('util'); + +var renderAST = function(tree) { + return util.inspect(tree, {depth: null}); +} + module.exports.DocParser = require('./blocks'); module.exports.HtmlRenderer = require('./html-renderer'); +module.exports.ASTRenderer = renderAST; |