emu-algify
Version:
Use Ecmarkup's <emu-alg> elements in your HTML
28 lines (25 loc) • 777 B
JavaScript
/* eslint-disable no-console */
/* eslint-disable no-process-exit */
;
const getStream = require('get-stream');
const yargs = require('yargs');
const emuAlgify = require('..');
const packageJson = require('../package.json');
const argv = yargs
.usage(`${packageJson.description}\n\n${packageJson.name} [--throwing-indicators] < input.html > output.html`)
.option('t', {
alias: 'throwing-indicators',
type: 'boolean',
describe: 'Add throws/nothrow indicators to headings'
})
.help()
.version()
.argv;
getStream(process.stdin)
.then(input => emuAlgify(input, { throwingIndicators: argv.throwingIndicators }))
.then(output => console.log(output))
.catch(e => {
console.error(e.stack);
process.exit(1);
});