deckdown
deckdown copied to clipboard
Pass markdown filename in via command line
I should be able to run node deckdown.js {preso_name} where preso_name is the markdown file to convert. The HTML should be saved alongside the preso name in the same dir.
Also consider renaming /pres to /presentations or decks.
marsh, can you work on that? That seems like a different path from the express API that I've been working on so far. CLI Branch?
Hey guys,
I like what you're working on. I tweaked some command-line code I already had. Maybe a head start? Anyways, good luck.
$ node deckdown.js
Please provide a markdown presentation (e.g. node [path/to/]deckdown.js [path/to/]presentation.md)
$ node deckdown.js markdown.md
# Presentation Slide Title
deckdown.js
var arguments = process.argv.slice(2),
preso_name = arguments[0] || '';
if(preso_name) {
var path = require('path'),
fs = require('fs');
try {
var preso_markdown = fs.readFileSync(path.resolve(preso_name), 'utf-8');
console.log(preso_markdown);
} catch(error) {
console.error(new Date().toUTCString() + ' caughtException:', error.message);
console.error(error.stack);
}
} else {
console.error('Please provide a markdown presentation (e.g. node [path/to/]deckdown.js [path/to/]presentation.md)');
}
markdown.md
# Presentation Slide Title