aboutsummaryrefslogtreecommitdiff
path: root/js/markdown
blob: 2b23d5438aac0d0437f68154a400563192f792fe (plain)
  1. #!/usr/bin/env node
  2. var fs = require('fs');
  3. var util = require('util');
  4. var stmd = require('./stmd');
  5. file = process.argv[2] || '/dev/stdin';
  6. fs.readFile(file, 'utf8', function(err, data) {
  7. if (err) {
  8. return console.log(err);
  9. }
  10. var parser = new stmd.DocParser();
  11. var renderer = new stmd.HtmlRenderer();
  12. process.stdout.write(renderer.render(parser.parse(data)));
  13. });