From 92fb304b7307f77a5c22e834631ef1952e5be099 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 24 Oct 2014 21:19:17 -0700 Subject: Rename js/bin/markdown -> js/bin/commonmark. --- js/bin/markdown | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100755 js/bin/markdown (limited to 'js/bin/markdown') diff --git a/js/bin/markdown b/js/bin/markdown deleted file mode 100755 index 1d395e0..0000000 --- a/js/bin/markdown +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env node -var fs = require('fs'); -var util = require('util'); -var commonmark = require('../lib/index.js'); - -var parser = new commonmark.DocParser(); -var renderer; -var inps = []; - -var output_ast = false; -var files = []; - -if (process.argv[2] === '--ast') { - output_ast = true; - files = process.argv.slice(3); - renderer = { render: function(x) { - return util.inspect(x, null, Infinity) + '\n'; - } }; -} else { - files = process.argv.slice(2); - renderer = new commonmark.HtmlRenderer(); -} - -if (files.length === 0) { - files = ['/dev/stdin']; -} - -for (var i = 0; i < files.length; i++) { - file = files[i]; - inps.push(fs.readFileSync(file, 'utf8')); -} - -process.stdout.write(renderer.render(parser.parse(inps.join('\n')))); -- cgit v1.2.3