markdown_it.js

changeset 30
3ac53da03439
parent 28
9b75d0f5e042
child 31
7b21ec8ec96a
equal deleted inserted replaced
29:d4b0773f5e06 30:3ac53da03439
19 "\\linear": "\\mathbb{L}" 19 "\\linear": "\\mathbb{L}"
20 } 20 }
21 }; 21 };
22 22
23 // process.argv[0] seems to be the node executable itself 23 // process.argv[0] seems to be the node executable itself
24 if(process.argv.length<=2){ 24 if(process.argv.length<=2 || process.argv.length>4){
25 console.error(`Usage: ${process.argv[1]} input_file`) 25 console.error(`Usage: ${process.argv[1]} input_file [katex_options.json]`)
26 process.exit(1); 26 process.exit(1);
27 }
28 if(process.argv.length>2){
29 katexOptions = JSON.parse(fs.readFileSync(process.argv[3]));
27 } 30 }
28 31
29 fs.readFile(process.argv[2], 'utf8', function (err, input) { 32 fs.readFile(process.argv[2], 'utf8', function (err, input) {
30 var output, md; 33 var output, md;
31 34

mercurial