Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Commit 1190cb2

Browse files
author
Christian Heindl
committed
add option to pass different wktohtmlpdf executable via argument
1 parent 53a2c14 commit 1190cb2

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ npm i -g raml2pdf-cli
1717
## Usage
1818

1919
```
20+
raml2pdf-cli input.raml output.pdf
21+
raml2pdf-cli -e /path/to/wkhtmltopdf input.raml output.pdf
2022
raml2pdf-cli --help
21-
raml2pdf-cli example.raml example.pdf
23+
raml2pdf-cli --version
2224
```
2325

2426
## Example output

bin/raml2pdf-cli

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ var raml2HtmlConfig = raml2html.getDefaultConfig(config.mainTemplate, config.tem
1616

1717
program
1818
.version(pjson.version)
19-
.usage('[RAML input file] [PDF output file]')
19+
.usage('[options] [RAML input file] [PDF output file]')
20+
.option('-e, --wkhtmltopdf [wktohtmlpdf]', 'Path to wkhtmltopdf executable (default: wkhtmltopdf)')
2021
.parse(process.argv);
2122

2223

@@ -26,6 +27,10 @@ if (program.args.length !== 2) {
2627
process.exit(1);
2728
}
2829

30+
if(program.wkhtmltopdf) {
31+
wkhtmltopdf.command = program.wkhtmltopdf;
32+
}
33+
2934
var input = program.args[0];
3035
var output = program.args[1];
3136

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "raml2pdf-cli",
33
"description": "RAML to PDF documentation generator",
4-
"version": "1.0.2",
4+
"version": "1.0.3",
55
"author": {
66
"name": "Christian Heindl",
77
"email": "christian.heindl@cebesoft.com"

0 commit comments

Comments
 (0)