Skip to content

Commit

Permalink
add --html-pdf-options deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhaenisch committed May 28, 2018
1 parent 1dc10ca commit 82bd49d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const args = arg({
'--body-class': [String],
'--highlight-style': String,
'--marked-options': String,
'--html-pdf-options': String,
'--pdf-options': String,
'--md-file-encoding': String,
'--stylesheet-encoding': String,
Expand Down Expand Up @@ -56,6 +57,15 @@ async function main(args, config) {
return 0;
}

if (args['--html-pdf-options']) {
console.warn(
[
chalk.red(`--html-pdf-options is not a valid argument anymore. Use --pdf-options instead.`),
chalk.gray(`valid options: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions`),
].join('\n'),
);
}

// markdown file has to be processed first in order to get front-matter config
const mdFileContent = readFile(path.resolve(mdFilePath), args['--md-file-encoding'] || config.md_file_encoding);
const { content: md, data: frontMatterConfig } = grayMatter(mdFileContent);
Expand Down

0 comments on commit 82bd49d

Please sign in to comment.