You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

playwright-docusaurus-pdf

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright-docusaurus-pdf

PDF generator for Docusaurus 2+ using Playwright

1.0.4
latest
npmnpm
Version published
Weekly downloads
8
60%
Maintainers
1
Weekly downloads
 
Created
Source

+

Playwright Docusaurus PDF

This project is still in active development. You can clone or fork the repository to use in your own projects.

PDF generator for Docusaurus 2.0+ using Playwright. Playwright will crawl your local site or published site to generate a PDF for all the available pages within the docs instance.

If you need to generate multiple PDFs for separate docs instances, invoke the CLI with the different base paths for the site.

Usage

npx playwright-docusaurus-pdf -o ./dist/output.pdf -base-url http://localhost:3000 -p /docs/welcome

Options

-o, --output-file

The destination path for the generated PDF.

-base-url, --base-url

The URL to open to crawl with playwright.

-p, --path

The initial page path to open.

-d, --delay

The option delay to add to page loads before capturing the image for the PDF. Used to offset long JavaScript render delays.

-r, --replace

Replace all instances of the baseUrl in link tags with a destination url. Used to replace local environment urls with a production url.

-f, --format

The page format such as A4. If unspecified, each page will resize to the scrollable width and height of the webpage.

Development

Install dependencies

npm install

Build

npm run build

To test the CLI locally, run the following command to link the /dist output with your global package registry.

npm link

FAQs

Package last updated on 29 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts