blob: 37b0e520189956c0f73393ee647abf7398d93de1 (
plain)
- #!/usr/bin/env node
- var fs = require('fs');
- var util = require('util');
- var commonmark = require('../lib/index.js');
- file = process.argv[2] || '/dev/stdin';
- fs.readFile(file, 'utf8', function(err, data) {
- if (err) {
- return console.log(err);
- }
- var parser = new commonmark.DocParser();
- var renderer = new commonmark.HtmlRenderer();
- process.stdout.write(renderer.render(parser.parse(data)));
- });
|