-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·27 lines (25 loc) · 1.05 KB
/
main.js
File metadata and controls
executable file
·27 lines (25 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env node
const program = require('commander');
const docogen = require('docogen');
const path = require('path');
// Parse
program
.version('0.0.1')
.option('-s, --src [path]', 'Specify the source script files',__dirname)
.option('-d, --dest [path]', 'The output result goes here', path.join(__dirname,'dest'))
.option('-H, --html [type]', 'Generate html release.','none')
.option('-L, --latex [output filename]', 'Generate Latex release','docogen-latex.pdf')
.parse(process.argv);
// Get Configuration
console.log(`DocoGen CLI Interface:\nConfiguration of docoGen generation ->`);
if (program.src) console.log(` - The Source files path: ${program.src}`);
if (program.dest) console.log(` - The Destination release package path: ${program.dest}`);
if (program.html != "none"){
console.log(` - Html Package: True, with template: ${program.html}`);
}
if (program.latex){
console.log(` - Latex Package: True`);
docogen.generate_latexpdf(program.src,program.dest,{output: "docogen"},(err,msg)=>{
console.log(msg)
})
}