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 || process.argv.length>4){ |
24 if(process.argv.length<=2 || process.argv.length>4){ |
25 console.error(`Usage: ${process.argv[1]} input_file [katex_options.json]`) |
25 console.error(`Usage: ${process.argv[1]} input_file [katex_options.json]`) |
26 process.exit(1); |
26 process.exit(1); |
27 } |
27 } |
28 if(process.argv.length>2){ |
28 if(process.argv.length>3){ |
29 katexOptions = JSON.parse(fs.readFileSync(process.argv[3])); |
29 katexOptions = JSON.parse(fs.readFileSync(process.argv[3])); |
30 } |
30 } |
31 |
31 |
32 fs.readFile(process.argv[2], 'utf8', function (err, input) { |
32 fs.readFile(process.argv[2], 'utf8', function (err, input) { |
33 var output, md; |
33 var output, md; |