aboutsummaryrefslogtreecommitdiff
path: root/js/lib/index.js
blob: d0532c67c5a96b907e19e2fe5fdb7a8edc9f3a47 (plain)
  1. // commonmark.js - CommomMark in JavaScript
  2. // Copyright (C) 2014 John MacFarlane
  3. // License: BSD3.
  4. // Basic usage:
  5. //
  6. // var commonmark = require('commonmark');
  7. // var parser = new commonmark.DocParser();
  8. // var renderer = new commonmark.HtmlRenderer();
  9. // console.log(renderer.render(parser.parse('Hello *world*')));
  10. "use strict";
  11. var util = require('util');
  12. var renderAST = function(tree) {
  13. return util.inspect(tree.toAST(), {depth: 20}) + '\n';
  14. };
  15. module.exports.Node = require('./node');
  16. module.exports.DocParser = require('./blocks');
  17. module.exports.HtmlRenderer = require('./html');
  18. module.exports.ASTRenderer = renderAST;