From df8264a6b0aded8c328844e259568a57cfc0bc10 Mon Sep 17 00:00:00 2001 From: Condor Hero Date: Thu, 1 Aug 2024 18:09:03 +0800 Subject: [PATCH] docs: repace new to true for headless option --- README.md | 2 +- src/commands/htmlExportPdf/createHtmlExportPdf.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d950b6c..e14219b 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,7 @@ Rules for automatically generating PDF file names. | `inputs` | `string[]` | `--inputs` | Input one or more local or online paths. | `[]` | | `outFile` | `string` | `--outFile` | Output file name. | {input}.pdf | | `outDir` | `string` | `--outDir` | Output directory. | `process.cwd()` | -| `headless` | `boolean` \| `new` | `--headless` | Whether to run the browser in headless mode. | `new` | +| `headless` | `boolean` \| `shell` | `--headless` | Whether to run the browser in headless mode. | `true` | | `PDFOptions` | `object` | | Valid options to configure PDF generation via Page.pdf(). | | | ┗ `scale` | `number` | `--scale` | Scales the rendering of the web page. Amount must be between 0.1 and 2. | 1 | | ┗ `headerTemplate` | `string` | `--headerTemplate` | HTML template for the print header. | | diff --git a/src/commands/htmlExportPdf/createHtmlExportPdf.ts b/src/commands/htmlExportPdf/createHtmlExportPdf.ts index 38375d7..457e0ca 100644 --- a/src/commands/htmlExportPdf/createHtmlExportPdf.ts +++ b/src/commands/htmlExportPdf/createHtmlExportPdf.ts @@ -9,7 +9,7 @@ export function createHtmlExportPdf(program: Command) { .option("-i, --inputs ", "Input one or more local or online paths", collectParameters, []) .option("-o, --outFile [outFile]", "Output file name(default: {input}.pdf)") .option("--outDir [outDir]", "Output directory(default: process.cwd())") - .option("--headless [headless]", "Whether to run the browser in headless mode(default: 'new')", (v) => { + .option("--headless [headless]", "Whether to run the browser in headless mode(default: true)", (v) => { if (v === "false") return false; @@ -17,7 +17,7 @@ export function createHtmlExportPdf(program: Command) { return true; return v; - }, "new") + }, true) // https://pptr.dev/api/puppeteer.pdfoptions .option("--scale ", "Scales the rendering of the web page. Amount must be between 0.1 and 2(default: 1)", v => Number(v), 1)