Update usage help

This commit is contained in:
Antonin Stefanutti 2023-05-23 11:26:47 +02:00 committed by Antonin Stefanutti
parent decfb3e4d3
commit 95c5345653
2 changed files with 22 additions and 21 deletions

View File

@ -124,21 +124,22 @@ filename Filename of the output PDF file
Options:
-s <size>, --size <size> Size of the slides deck viewport: <width>x<height> (e.g. '1280x720')
-p <ms>, --pause <ms> Duration in milliseconds before each slide is exported [1000]
--load-pause <ms> Duration in milliseconds between the page has loaded
and starting to export slides [0]
--url-load-timeout <ms> Timeout in milliseconds to use when waiting for the initial
URL to load [60000]
--page-load-timeout <ms> Timeout in milliseconds to use when waiting for the slide deck
page to load [20000]
--load-pause <ms> Duration in milliseconds between the page has loaded and starting to export slides [0]
--url-load-timeout <ms> Timeout in milliseconds to use when waiting for the initial URL to load [60000]
--page-load-timeout <ms> Timeout in milliseconds to use when waiting for the slide deck page to load [20000]
--buffer-timeout <ms> Timeout in milliseconds to use when waiting for a slide to finish buffering (set to 0 to disable) [30000]
--screenshots Capture each slide as an image [false]
--screenshots-directory <dir> Screenshots output directory [screenshots]
--screenshots-size <size> Screenshots resolution, can be repeated [--size]
--screenshots-size <size> Screenshots resolution, can be repeated
--screenshots-format <format> Screenshots image format, one of [jpg, png] [png]
--slides <range> Range of slides to be exported, a combination of slide indexes
and ranges (e.g. '1-3,5,8')
--chrome-path <path> Path to the Chromium or Chrome executable to run instead of the
bundled Chromium
--slides <range> Range of slides to be exported, a combination of slide indexes and ranges (e.g. '1-3,5,8')
--headless Puppeteer headless mode, one if [new, true, false] [new]
--headers HTTP headers, comma-separated list of <header>,<value> pairs (e.g. "Authorization,'Bearer ASDJASLKJALKSJDL'")
--chrome-path <path> Path to the Chromium or Chrome executable to run instead of the bundled Chromium
--chrome-arg <arg> Additional argument to pass to the Chrome instance, can be repeated
--pdf-author <arg> String to set as the author of the resulting PDF document
--pdf-title <arg> String to set as the title of the resulting PDF document
--pdf-subject <arg> String to set as the subject of the resulting PDF document
Defaults to the automatic command.
Iterates over the available plugins, picks the compatible one for presentation at the

View File

@ -104,13 +104,13 @@ parser.script('decktape').options({
},
headless : {
default : 'new', // false to enable headed mode and true to enable old puppeteer headless. See: https://developer.chrome.com/articles/new-headless/#new-headless-in-puppeteer
help : 'Control headless mode puppeteer.',
help : 'Puppeteer headless mode, one if [new, true, false]',
},
headers : {
type : 'string',
callback : parseHeaders,
transform : parseHeaders,
help : 'Add headers to puppetter page instance. Comma deliminated list of strings. <header>,<value>. E.g. -headers "Authorization,\'Bearer ASDJASLKJALKSJDL\'"',
help : 'HTTP headers, comma-separated list of <header>,<value> pairs (e.g. "Authorization,\'Bearer ASDJASLKJALKSJDL\'")',
},
// Chrome options
chromePath : {
@ -131,32 +131,32 @@ parser.script('decktape').options({
full : 'pdf-author',
metavar : '<arg>',
type : 'string',
help : 'String to set as the author of the resulting pdf document',
help : 'String to set as the author of the resulting PDF document',
},
metaTitle : {
full : 'pdf-title',
metavar : '<arg>',
type : 'string',
help : 'String to set as the title of the resulting pdf document',
help : 'String to set as the title of the resulting PDF document',
},
metaSubject : {
full : 'pdf-subject',
metavar : '<arg>',
type : 'string',
help : 'String to set as the subject of the resulting pdf document',
help : 'String to set as the subject of the resulting PDF document',
},
});
function parseHeaders(headerString) {
const h = headerString.split(",")
const h = headerString.split(",");
if ((h.length % 2) != 0) {
return 'header flag must be a comma delimited key value pairing and should always have an even number of kv pairs'
return 'header flag must be a comma delimited key value pairing and should always have an even number of kv pairs';
}
let headers = {}
let headers = {};
for (let i = 0; i < h.length; i += 2) {
headers[h[i]] = h[i+1]
headers[h[i]] = h[i+1];
}
return headers
return headers;
}
function parseSize(size) {