summaryrefslogtreecommitdiff
path: root/js/markdown
blob: 2b23d5438aac0d0437f68154a400563192f792fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env node
var fs = require('fs');
var util = require('util');
var stmd = require('./stmd');

file = process.argv[2] || '/dev/stdin';

fs.readFile(file, 'utf8', function(err, data) {
  if (err) {
    return console.log(err);
  }
  var parser   = new stmd.DocParser();
  var renderer = new stmd.HtmlRenderer();
  process.stdout.write(renderer.render(parser.parse(data)));
});