{"_id":"@ashleyharwood/docs-to-pdf","_rev":"5-6c21dcd4a4f9940be96dccc011cd1df2","name":"@ashleyharwood/docs-to-pdf","dist-tags":{"latest":"1.1.0-fork.5"},"versions":{"1.1.0-fork.1":{"name":"@ashleyharwood/docs-to-pdf","version":"1.1.0-fork.1","keywords":["pdf","docusaurus","gitbook"],"author":{"url":"https://github.com/jean-humann","name":"Jean Humann","email":"jean.humann@gmail.com"},"license":"MIT","_id":"@ashleyharwood/docs-to-pdf@1.1.0-fork.1","maintainers":[{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"}],"homepage":"https://github.com/ashleythedeveloper/docs-to-pdf","bin":{"docs-to-pdf":"lib/cli.js"},"dist":{"shasum":"7774b08e6f1fe2c246bb8c480a23f468b939e89b","tarball":"https://registry.npmjs.org/@ashleyharwood/docs-to-pdf/-/docs-to-pdf-1.1.0-fork.1.tgz","fileCount":10,"integrity":"sha512-UuytHnYt+343zMFngrGzi9nhHvt4hQDG5JUHDPCVZZtah4yPuqr00EQI+sLc67zQAjGmTb24vnPAtmiYzLK/wA==","signatures":[{"sig":"MEUCIH3UIptX6bTazQVM3L1qSpC4m78Lf6j4Mj9uNF6CxneHAiEA9DqER431ucbOACgzQ6maY3tXHo7nvgvr9X1t1eIcOD0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73565},"main":"lib/cli.js","engines":{"node":">=20.0.0"},"gitHead":"bbffeb774888a3d1529de50c1ee3baafaef209f0","scripts":{"dev":"tsc --watch","lint":"eslint \"*/**/*.{js,ts}\"","test":"jest --detectOpenHandles --forceExit","build":"tsc","prepare":"husky","lint:fix":"eslint \"*/**/*.{js,ts}\" --fix","commitlint":"commitlint --from=HEAD~1"},"_npmUser":{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"},"_npmVersion":"10.8.2","description":"Generate PDF from Docusaurus","directories":{},"lint-staged":{"*.{js,ts}":["./node_modules/.bin/eslint --fix"]},"_nodeVersion":"20.19.3","dependencies":{"chalk":"^5.6.2","express":"^5.1.0","fs-extra":"^11.2.0","commander":"^14.0.1","puppeteer":"^24.0.0","console-stamp":"^3.1.2","sanitize-html":"^2.17.0","puppeteer-core":"^24.0.0","puppeteer-autoscroll-down":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","husky":"^9.1.7","eslint":"^9.17.0","core-js":"^3.39.0","ts-jest":"^29.4.5","ts-node":"^10.9.2","prettier":"^3.4.2","supertest":"^7.0.0","commitlint":"^20.1.0","jest-junit":"^16.0.0","typescript":"^5.7.2","@types/jest":"^30.0.0","@types/node":"^24.9.1","lint-staged":"^16.2.6","@jest/globals":"^30.2.0","@types/express":"^5.0.0","@commitlint/cli":"^20.1.0","@types/fs-extra":"^11.0.1","@tsconfig/node20":"^20.1.4","@types/supertest":"^6.0.2","@types/sanitize-html":"^2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.2.1","jest-environment-jsdom":"^30.2.0","@typescript-eslint/parser":"^8.18.2","@commitlint/config-conventional":"^20.0.0","@typescript-eslint/eslint-plugin":"^8.18.2"},"_npmOperationalInternal":{"tmp":"tmp/docs-to-pdf_1.1.0-fork.1_1764024539023_0.7223606281989989","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-fork.2":{"name":"@ashleyharwood/docs-to-pdf","version":"1.1.0-fork.2","keywords":["pdf","docusaurus","gitbook"],"author":{"url":"https://github.com/jean-humann","name":"Jean Humann","email":"jean.humann@gmail.com"},"license":"MIT","_id":"@ashleyharwood/docs-to-pdf@1.1.0-fork.2","maintainers":[{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"}],"homepage":"https://github.com/ashleythedeveloper/docs-to-pdf","bin":{"docs-to-pdf":"lib/cli.js"},"dist":{"shasum":"48dc75a1e293ce40465a2f1aeaff43e3088d3085","tarball":"https://registry.npmjs.org/@ashleyharwood/docs-to-pdf/-/docs-to-pdf-1.1.0-fork.2.tgz","fileCount":10,"integrity":"sha512-5MEKv91fwOFPQrfnFBnvOCH5G6Y/TZqtogIqwENCxXlxrsfgG0bVxDgDgtxgk9QwanP1CiLWfM1kc+qBuU83hA==","signatures":[{"sig":"MEYCIQDVw2Qpxk1lNeUivMK/MPTpyiWeF0QjeXLUF6bEtDaSZwIhAMt8F50TcbVqrIeKx+dodF1VH0ezGBg7pVblk8/IDqAY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73564},"main":"lib/cli.js","engines":{"node":">=20.0.0"},"gitHead":"bbffeb774888a3d1529de50c1ee3baafaef209f0","scripts":{"dev":"tsc --watch","lint":"eslint \"*/**/*.{js,ts}\"","test":"jest --detectOpenHandles --forceExit","build":"tsc","prepare":"husky","lint:fix":"eslint \"*/**/*.{js,ts}\" --fix","commitlint":"commitlint --from=HEAD~1"},"_npmUser":{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"},"_npmVersion":"10.8.2","description":"Generate PDF from Docusaurus","directories":{},"lint-staged":{"*.{js,ts}":["./node_modules/.bin/eslint --fix"]},"_nodeVersion":"20.19.3","dependencies":{"chalk":"4.1.2","express":"^5.1.0","fs-extra":"^11.2.0","commander":"^14.0.1","puppeteer":"^24.0.0","console-stamp":"^3.1.2","sanitize-html":"^2.17.0","puppeteer-core":"^24.0.0","puppeteer-autoscroll-down":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","husky":"^9.1.7","eslint":"^9.17.0","core-js":"^3.39.0","ts-jest":"^29.4.5","ts-node":"^10.9.2","prettier":"^3.4.2","supertest":"^7.0.0","commitlint":"^20.1.0","jest-junit":"^16.0.0","typescript":"^5.7.2","@types/jest":"^30.0.0","@types/node":"^24.9.1","lint-staged":"^16.2.6","@jest/globals":"^30.2.0","@types/express":"^5.0.0","@commitlint/cli":"^20.1.0","@types/fs-extra":"^11.0.1","@tsconfig/node20":"^20.1.4","@types/supertest":"^6.0.2","@types/sanitize-html":"^2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.2.1","jest-environment-jsdom":"^30.2.0","@typescript-eslint/parser":"^8.18.2","@commitlint/config-conventional":"^20.0.0","@typescript-eslint/eslint-plugin":"^8.18.2"},"_npmOperationalInternal":{"tmp":"tmp/docs-to-pdf_1.1.0-fork.2_1764109602949_0.308421967464221","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-fork.3":{"name":"@ashleyharwood/docs-to-pdf","version":"1.1.0-fork.3","keywords":["pdf","docusaurus","gitbook"],"author":{"url":"https://github.com/jean-humann","name":"Jean Humann","email":"jean.humann@gmail.com"},"license":"MIT","_id":"@ashleyharwood/docs-to-pdf@1.1.0-fork.3","maintainers":[{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"}],"homepage":"https://github.com/ashleythedeveloper/docs-to-pdf","bin":{"docs-to-pdf":"lib/cli.js"},"dist":{"shasum":"ce199061900aa476c39d350d8e2b9c02675ab3cb","tarball":"https://registry.npmjs.org/@ashleyharwood/docs-to-pdf/-/docs-to-pdf-1.1.0-fork.3.tgz","fileCount":10,"integrity":"sha512-tY0gs5jWKNl/SMMXuOybnkMZdL81x7t+iz7dW9T9foDG4td3PzjSOciU1s0l39E31KfprGIjT0291c/zouoHSw==","signatures":[{"sig":"MEYCIQChp63WCIH3rwZxqD1ukc6ROx8hqYB7+QHIiTidRm8lbAIhAJM179q28Z+QKJ2mM5NW59uiAaEeSXqq4x5jKnQD4PMT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73563},"main":"lib/cli.js","engines":{"node":">=20.0.0"},"gitHead":"bbffeb774888a3d1529de50c1ee3baafaef209f0","scripts":{"dev":"tsc --watch","lint":"eslint \"*/**/*.{js,ts}\"","test":"jest --detectOpenHandles --forceExit","build":"tsc","prepare":"husky","lint:fix":"eslint \"*/**/*.{js,ts}\" --fix","commitlint":"commitlint --from=HEAD~1"},"_npmUser":{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"},"_npmVersion":"10.8.2","description":"Generate PDF from Docusaurus","directories":{},"lint-staged":{"*.{js,ts}":["./node_modules/.bin/eslint --fix"]},"_nodeVersion":"20.19.3","dependencies":{"chalk":"4.1.2","express":"^5.1.0","fs-extra":"^11.2.0","commander":"^14.0.1","puppeteer":"^24.0.0","console-stamp":"^3.1.2","sanitize-html":"^2.17.0","puppeteer-core":"^24.0.0","puppeteer-autoscroll-down":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","husky":"^9.1.7","eslint":"^9.17.0","core-js":"^3.39.0","ts-jest":"^29.4.5","ts-node":"^10.9.2","prettier":"^3.4.2","supertest":"^7.0.0","commitlint":"^20.1.0","jest-junit":"^16.0.0","typescript":"^5.7.2","@types/jest":"^30.0.0","@types/node":"^24.9.1","lint-staged":"^16.2.6","@jest/globals":"^30.2.0","@types/express":"^5.0.0","@commitlint/cli":"^20.1.0","@types/fs-extra":"^11.0.1","@tsconfig/node20":"^20.1.4","@types/supertest":"^6.0.2","@types/sanitize-html":"^2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.2.1","jest-environment-jsdom":"^30.2.0","@typescript-eslint/parser":"^8.18.2","@commitlint/config-conventional":"^20.0.0","@typescript-eslint/eslint-plugin":"^8.18.2"},"_npmOperationalInternal":{"tmp":"tmp/docs-to-pdf_1.1.0-fork.3_1764118422473_0.4640477422941205","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-fork.4":{"name":"@ashleyharwood/docs-to-pdf","version":"1.1.0-fork.4","keywords":["pdf","docusaurus","gitbook"],"author":{"url":"https://github.com/jean-humann","name":"Jean Humann","email":"jean.humann@gmail.com"},"license":"MIT","_id":"@ashleyharwood/docs-to-pdf@1.1.0-fork.4","maintainers":[{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"}],"homepage":"https://github.com/ashleythedeveloper/docs-to-pdf","bin":{"docs-to-pdf":"lib/cli.js"},"dist":{"shasum":"5ccfcd84b8ceeb22ce66a5e6f090636e17aad6ef","tarball":"https://registry.npmjs.org/@ashleyharwood/docs-to-pdf/-/docs-to-pdf-1.1.0-fork.4.tgz","fileCount":10,"integrity":"sha512-XJfsd3Z+7o/VR+lyo2CaUZ0lMaNgEFUBai2dDkx/YKS5WoSlUPljpCTTDyizoaRH5+rBSFch7s07YHlcIpZc1g==","signatures":[{"sig":"MEUCIQDqo5Uk77QxL4FviasTolIKYszSr/7rOABwS8l/Ji9KSQIgP0N3rfQA/9PCLHbvNNvTz6Q0WWWHKu0B2plcjEucYRs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73577},"main":"lib/cli.js","engines":{"node":">=20.0.0"},"gitHead":"0ec5358f323a656681894f1c2eeb66b366b9cd36","scripts":{"dev":"tsc --watch","lint":"eslint \"*/**/*.{js,ts}\"","test":"jest --detectOpenHandles --forceExit","build":"tsc","prepare":"husky","lint:fix":"eslint \"*/**/*.{js,ts}\" --fix","commitlint":"commitlint --from=HEAD~1"},"_npmUser":{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"},"_npmVersion":"10.8.2","description":"Generate PDF from Docusaurus","directories":{},"lint-staged":{"*.{js,ts}":["./node_modules/.bin/eslint --fix"]},"_nodeVersion":"20.19.3","dependencies":{"chalk":"4.1.2","express":"^5.1.0","fs-extra":"^11.2.0","commander":"^14.0.1","puppeteer":"^24.0.0","console-stamp":"^3.1.2","sanitize-html":"^2.17.0","puppeteer-core":"^24.0.0","puppeteer-autoscroll-down":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.2.0","husky":"^9.1.7","eslint":"^9.17.0","core-js":"^3.39.0","ts-jest":"^29.4.5","ts-node":"^10.9.2","prettier":"^3.4.2","supertest":"^7.0.0","commitlint":"^20.1.0","jest-junit":"^16.0.0","typescript":"^5.7.2","@types/jest":"^30.0.0","@types/node":"^24.9.1","lint-staged":"^16.2.6","@jest/globals":"^30.2.0","@types/express":"^5.0.0","@commitlint/cli":"^20.1.0","@types/fs-extra":"^11.0.1","@tsconfig/node20":"^20.1.4","@types/supertest":"^6.0.2","@types/sanitize-html":"^2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.2.1","jest-environment-jsdom":"^30.2.0","@typescript-eslint/parser":"^8.18.2","@commitlint/config-conventional":"^20.0.0","@typescript-eslint/eslint-plugin":"^8.18.2"},"_npmOperationalInternal":{"tmp":"tmp/docs-to-pdf_1.1.0-fork.4_1773622913634_0.02654821269684171","host":"s3://npm-registry-packages-npm-production"}},"1.1.0-fork.5":{"name":"@ashleyharwood/docs-to-pdf","version":"1.1.0-fork.5","description":"Generate PDF from Docusaurus","main":"lib/cli.js","scripts":{"dev":"tsc --watch","build":"tsc","commitlint":"commitlint --from=HEAD~1","prepare":"husky","lint":"eslint \"*/**/*.{js,ts}\"","lint:fix":"eslint \"*/**/*.{js,ts}\" --fix","test":"jest --detectOpenHandles --forceExit"},"engines":{"node":">=20.0.0"},"bin":{"docs-to-pdf":"lib/cli.js"},"keywords":["pdf","docusaurus","gitbook"],"homepage":"https://github.com/ashleythedeveloper/docs-to-pdf","author":{"name":"Jean Humann","email":"jean.humann@gmail.com","url":"https://github.com/jean-humann"},"license":"MIT","dependencies":{"chalk":"4.1.2","commander":"^14.0.1","console-stamp":"^3.1.2","express":"^5.1.0","fs-extra":"^11.2.0","puppeteer":"^24.0.0","puppeteer-autoscroll-down":"1.1.2","puppeteer-core":"^24.0.0","sanitize-html":"^2.17.0"},"devDependencies":{"@commitlint/cli":"^20.1.0","@commitlint/config-conventional":"^20.0.0","@jest/globals":"^30.2.0","@tsconfig/node20":"^20.1.4","@types/express":"^5.0.0","@types/fs-extra":"^11.0.1","@types/jest":"^30.0.0","@types/node":"^24.9.1","@types/sanitize-html":"^2","@types/supertest":"^6.0.2","@typescript-eslint/eslint-plugin":"^8.18.2","@typescript-eslint/parser":"^8.18.2","commitlint":"^20.1.0","core-js":"^3.39.0","eslint":"^9.17.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.2.1","husky":"^9.1.7","jest":"^30.2.0","jest-environment-jsdom":"^30.2.0","jest-junit":"^16.0.0","lint-staged":"^16.2.6","prettier":"^3.4.2","supertest":"^7.0.0","ts-jest":"^29.4.5","ts-node":"^10.9.2","typescript":"^5.7.2"},"lint-staged":{"*.{js,ts}":["./node_modules/.bin/eslint --fix"]},"_id":"@ashleyharwood/docs-to-pdf@1.1.0-fork.5","gitHead":"0ec5358f323a656681894f1c2eeb66b366b9cd36","_nodeVersion":"20.19.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Bxa2FNSV5oRwIS+WrcbDgpZqKnssC11DWQwBdDnHJGVcP9Pa5u01dDlk1lT4257yx3JMdBQuOK/Gl5bh8cPe8A==","shasum":"65ed824f9c357086a15bbd4be4541e7990417312","tarball":"https://registry.npmjs.org/@ashleyharwood/docs-to-pdf/-/docs-to-pdf-1.1.0-fork.5.tgz","fileCount":10,"unpackedSize":73576,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCH1Muq3/s1/HIb+C1KCK1Cea+Qoi+9QGD0/GQz8bG31wIgegxHcSBesqxhGV9mVEfE2yhTg0jQC3a7drfgqksUXoU="}]},"_npmUser":{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"},"directories":{},"maintainers":[{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/docs-to-pdf_1.1.0-fork.5_1773626640322_0.5662722040797543"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-24T22:48:58.955Z","modified":"2026-03-16T02:04:00.573Z","1.1.0-fork.1":"2025-11-24T22:48:59.208Z","1.1.0-fork.2":"2025-11-25T22:26:43.176Z","1.1.0-fork.3":"2025-11-26T00:53:42.681Z","1.1.0-fork.4":"2026-03-16T01:01:53.774Z","1.1.0-fork.5":"2026-03-16T02:04:00.465Z"},"author":{"name":"Jean Humann","email":"jean.humann@gmail.com","url":"https://github.com/jean-humann"},"license":"MIT","homepage":"https://github.com/ashleythedeveloper/docs-to-pdf","keywords":["pdf","docusaurus","gitbook"],"description":"Generate PDF from Docusaurus","maintainers":[{"name":"ashleyharwood","email":"ashley.harwood@gosource.com.au"}],"readme":"# Docs to PDF\n\n[![npm](https://img.shields.io/npm/v/docs-to-pdf?label=NPM%20STABLE&style=for-the-badge)](https://www.npmjs.com/package/docs-to-pdf)\n![node-current](https://img.shields.io/node/v/docs-to-pdf?style=for-the-badge)\n![npm](https://img.shields.io/npm/dt/docs-to-pdf?style=for-the-badge)\n[![Codecov](https://img.shields.io/codecov/c/gh/jean-humann/docs-to-pdf/master?token=YMY82958X4&style=for-the-badge)](https://codecov.io/gh/jean-humann/docs-to-pdf)\n![GitHub](https://img.shields.io/github/license/jean-humann/docs-to-pdf?style=for-the-badge)\n\n## ⚡ Requirements\n\n- Node.js >= 20.0.0\n\n## 📌 Introduction\n\nThis is a PDF generator from document website such as `docusaurus`. This is a fork of [mr-pdf](https://github.com/KohheePeace/mr-pdf) which was not maintained anymore.\nFeel free to contribute to this project.\n\n## 📦 Installation\n\n```shell\nnpm install -g docs-to-pdf\n```\n\n## 🚀 Quick Start\n\n```shell\nnpx docs-to-pdf --initialDocURLs=\"https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1\" --contentSelector=\"article\" --paginationSelector=\"a.pagination-nav__link.pagination-nav__link--next\" --excludeSelectors=\".margin-vert--xl a,[class^='tocCollapsible'],.breadcrumbs,.theme-edit-this-page\" --coverImage=\"https://docusaurus.io/img/docusaurus.png\" --coverTitle=\"Docusaurus v2\"\n```\n\n## ⚡ Usage\n\nFor [Docusaurus v2](https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1)\n\n```shell\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1\"\n```\n\nOR\n\n```shell\nnpx docs-to-pdf --initialDocURLs=\"https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1\" --contentSelector=\"article\" --paginationSelector=\"a.pagination-nav__link.pagination-nav__link--next\" --excludeSelectors=\".margin-vert--xl a,[class^='tocCollapsible'],.breadcrumbs,.theme-edit-this-page\" --coverImage=\"https://docusaurus.io/img/docusaurus.png\" --coverTitle=\"Docusaurus v2\"\n```\n\n## 🍗 CLI Global Options\n\n| Option                 | Required | Description                                                                                                                                                                        |\n| ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `--initialDocURLs`     | Yes      | set URL to start generating PDF from.                                                                                                                                              |\n| `--contentSelector`    | No       | used to find the part of main content                                                                                                                                              |\n| `--paginationSelector` | No       | CSS Selector used to find next page to be printed for looping.                                                                                                                     |\n| `--excludeURLs`        | No       | URLs to be excluded in PDF                                                                                                                                                         |\n| `--excludeSelectors`   | No       | exclude selectors from PDF. Separate each selector **with comma and no space**. But you can use space in each selector. ex: `--excludeSelectors=\".nav,.next > a\"`                  |\n| `--cssStyle`           | No       | CSS style to adjust PDF output ex: `--cssStyle=\"body{padding-top: 0;}\"` \\*If you're project owner you can use `@media print { }` to edit CSS for PDF.                              |\n| `--outputPDFFilename`  | No       | name of the output PDF file. Default is `docs-to-pdf.pdf`                                                                                                                          |\n| `--pdfMargin`          | No       | set margin around PDF file. Separate each margin **with comma and no space**. ex: `--pdfMargin=\"10,20,30,40\"`. This sets margin `top: 10px, right: 20px, bottom: 30px, left: 40px` |\n| `--paperFormat`        | No       | pdf format ex: `--paperFormat=\"A3\"`. Please check this link for available formats [Puppeteer document](https://pptr.dev/api/puppeteer.paperformat)                                 |\n| `--coverTitle`         | No       | Title for the PDF cover.                                                                                                                                                           |\n| `--coverImage`         | No       | `<src>` Image for PDF cover (does not support SVG)                                                                                                                                 |\n| `--coverSub`           | No       | Subtitle the for PDF cover. Add `<br/>` tags for multiple lines.                                                                                                                   |\n| `--tocTitle`           | No       | Title for the table of contents.                                                                                                                                                   |\n| `--disableCover`       | No       | Optional toggle to show the PDF cover or not                                                                                                                                       |\n| `--disableTOC`         | No       | Optional toggle to show the table of contents or not                                                                                                                               |\n| `--headerTemplate`     | No       | HTML template for the print header. Please check this link for details of injecting values [Puppeteer document](https://pptr.dev/#?product=Puppeteer&show=api-pagepdfoptions)      |\n| `--footerTemplate`     | No       | HTML template for the print footer. Please check this link for details of injecting values [Puppeteer document](https://pptr.dev/#?product=Puppeteer&show=api-pagepdfoptions)      |\n| `--puppeteerArgs`      | No       | Add puppeteer BrowserLaunchArgumentOptions arguments ex: --sandbox [Puppeteer document](https://pptr.dev/api/puppeteer.browserlaunchargumentoptions)                               |\n| `--protocolTimeout`    | No       | Timeout setting for individual protocol calls in milliseconds. If omitted, the default value of 180000 ms (3 min) is used                                                          |\n| `--filterKeyword`      | No       | Only adds pages to the PDF containing a given meta keywords. Makes it possible to generate PDFs of selected pages                                                                  |\n| `--baseUrl`            | No       | Base URL for all relative URLs. Allows to render the pdf on localhost (ci/Github Actions) while referencing the deployed page.                                                     |\n| `--excludePaths`       | No       | URL Paths to be excluded                                                                                                                                                           |\n| `--restrictPaths`      | No       | Keep Only URL Path with the same rootPath as `--initialDocURLs`                                                                                                                    |\n| `--extractIframes`     | No       | Extract and inline content from iframes (only same-origin or accessible iframes). Default is `false`                                                                               |\n| `--httpAuthUser`       | No       | HTTP Basic Auth username for protected documentation sites                                                                                                                         |\n| `--httpAuthPassword`   | No       | HTTP Basic Auth password for protected documentation sites                                                                                                                         |\n\n## Docusaurus Options\n\n| Option      | Required | Description                                                                                                                                                       |\n| ----------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `--version` | No       | Docusaurus version. Default is 2. Supported versions: 1, 2, and 3.                                                                                                |\n| `--docsDir` | No       | Path to Docusaurus build dir. Either absolute or relative from path of the shell. The local server will automatically find an available port if 3000 is occupied. |\n\n## 📚 Docusaurus Version Support\n\ndocs-to-pdf supports **Docusaurus v1 (legacy), v2, and v3**. The tool automatically applies the correct selectors based on the version you specify.\n\n### Version Differences\n\n- **Docusaurus v1 (Legacy)**: Older documentation format with different HTML structure and navigation\n- **Docusaurus v2**: Uses `<article>` tag as the main content selector\n- **Docusaurus v3**: Uses `<main>` tag as the main content selector (changed from v2)\n\n### Usage\n\nWhen using the `docusaurus` command, specify the version with the `--version` flag:\n\n```shell\n# Docusaurus v1\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://your-site.com/docs\" --version=1\n\n# Docusaurus v2 (default)\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://your-site.com/docs\" --version=2\n\n# Docusaurus v3\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://your-site.com/docs\" --version=3\n```\n\nIf you omit the `--version` flag, it defaults to version 2.\n\n## 🎨 Examples and Demo PDF\n\n### Docusaurus v2\n\n![20210603060438](https://user-images.githubusercontent.com/29557494/120552058-b4299e00-c431-11eb-833e-1ac1338b0a70.gif)\n\n<https://docusaurus-archive-october-2023.netlify.app/>\n\n`initialDocURLs`: <https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1>\n\n`demoPDF`: <https://github.com/jean-humann/docs-to-pdf/blob/master/pdf/v2-docusaurus.pdf>\n\n`command`:\n\n```shell\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1\"\n```\n\nOR\n\n```shell\nnpx docs-to-pdf --initialDocURLs=\"https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1\" --contentSelector=\"article\" --paginationSelector=\"a.pagination-nav__link.pagination-nav__link--next\" --excludeSelectors=\".margin-vert--xl a,[class^='tocCollapsible'],.breadcrumbs,.theme-edit-this-page\" --coverImage=\"https://docusaurus.io/img/docusaurus.png\" --coverTitle=\"Docusaurus v2\"\n```\n\n### Docusaurus v3\n\nDocusaurus v3 uses `<main>` as the content selector instead of `<article>`. Here's an example:\n\n`command`:\n\n```shell\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://your-docusaurus-v3-site.com/docs/\" --version=3\n```\n\nOR with explicit selectors:\n\n```shell\nnpx docs-to-pdf --initialDocURLs=\"https://your-docusaurus-v3-site.com/docs/\" --contentSelector=\"main\" --paginationSelector=\"a.pagination-nav__link.pagination-nav__link--next\" --excludeSelectors=\".margin-vert--xl a,[class^='tocCollapsible'],.breadcrumbs,.theme-edit-this-page\" --coverImage=\"https://your-docusaurus-v3-site.com/img/logo.png\" --coverTitle=\"Your Docs\"\n```\n\n**Note**: Docusaurus v3 changed the main content wrapper from `<article>` (v2) to `<main>` (v3). The `--version=3` flag automatically uses the correct `main` selector.\n\n### Extracting Content from Iframes\n\nBy default, docs-to-pdf only captures the `<iframe>` tag itself, but not the content loaded inside it. If your documentation pages contain iframes with important content (e.g., embedded demos, interactive examples), you can use the `--extractIframes` option to extract and inline their content into the PDF.\n\n```shell\n# Enable iframe extraction\nnpx docs-to-pdf --initialDocURLs=\"https://your-site.com/docs\" --contentSelector=\"article\" --paginationSelector=\"a.pagination-nav__link--next\" --extractIframes\n```\n\nWith Docusaurus:\n\n```shell\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://your-site.com/docs\" --extractIframes\n```\n\n**How it works:**\n\n- Detects all `<iframe>` elements on each page\n- Extracts content from accessible iframes (same-origin or accessible cross-origin)\n- Replaces the iframe tag with a styled `<div>` containing the extracted content\n- Preserves iframe metadata (title, src) in the extracted content\n- Gracefully skips cross-origin iframes that cannot be accessed due to CORS restrictions\n\n**Limitations:**\n\n- Only works with same-origin iframes or iframes that allow cross-origin access\n- Cross-origin iframes blocked by CORS policy will be skipped\n- The feature is opt-in and disabled by default for backward compatibility\n\n**When to use:**\n\n- Your documentation contains embedded examples in iframes\n- You want to include interactive demos in the PDF\n- Your site uses iframes for content that should appear in the PDF\n\n### Using HTTP Basic Authentication\n\nIf your documentation site is protected with HTTP Basic Authentication, you can provide credentials using the `--httpAuthUser` and `--httpAuthPassword` options:\n\n```shell\nnpx docs-to-pdf --initialDocURLs=\"https://protected-docs.example.com/docs\" --contentSelector=\"article\" --paginationSelector=\"a.pagination-nav__link--next\" --httpAuthUser=\"myusername\" --httpAuthPassword=\"mypassword\"\n```\n\nThis works with both the `core` and `docusaurus` commands:\n\n```shell\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://protected-docs.example.com/docs\" --httpAuthUser=\"myusername\" --httpAuthPassword=\"mypassword\"\n```\n\n**Security Note**: Be cautious when using credentials in command-line arguments, as they may be visible in shell history. Consider using environment variables or other secure methods for sensitive credentials in production environments.\n\n### Docusaurus v1 - Legacy\n\n<https://docusaurus.io/en/>\n\n`initialDocURLs`: <https://docusaurus.io/docs/en/installation>\n\n`demoPDF`: <https://github.com/jean-humann/docs-to-pdf/blob/master/pdf/v1-docusaurus.pdf>\n\n`command`:\n\n```shell\nnpx docs-to-pdf docusaurus --initialDocURLs=\"https://docusaurus.io/docs/en/installation\" --version=1\n```\n\nOR\n\n```shell\nnpx docs-to-pdf --initialDocURLs=\"https://docusaurus.io/docs/en/installation\" --contentSelector=\"article\" --paginationSelector=\".docs-prevnext > a.docs-next\" --excludeSelectors=\".fixedHeaderContainer,footer.nav-footer,#docsNav,nav.onPageNav,a.edit-page-link,div.docs-prevnext\" --cssStyle=\".navPusher {padding-top: 0;}\" --pdfMargin=\"20\"\n```\n\n#### PR to add new docs is welcome here... 😸\n\n## 🐳 Docker Support\n\nDocker images are available for running docs-to-pdf in containerized environments. Images are published for multiple Node.js versions (20, 22, 24) and both Alpine and Debian-based distributions.\n\n### Quick Start with Docker\n\n```bash\n# Pull the latest image (Alpine with Node 24)\ndocker pull ghcr.io/jean-humann/docs-to-pdf:latest-node24-alpine\n\n# Generate a PDF\ndocker run --rm -v $(pwd)/output:/docs-to-pdf/output \\\n  ghcr.io/jean-humann/docs-to-pdf:latest-node24-alpine \\\n  bash -c \"docs-to-pdf --initialDocURLs='https://docusaurus-archive-october-2023.netlify.app/docs/2.3.1' --outputPDFFilename='output/docs.pdf'\"\n```\n\n### Available Image Tags\n\nImages follow the pattern: `<version>-node<X>-<os>`\n\nExamples:\n\n- `latest-node24-alpine` - Latest version with Node 24 on Alpine\n- `latest-node22-debian` - Latest version with Node 22 on Debian\n- `v1.2.3-node20-alpine` - Specific version with Node 20 on Alpine\n\n### Development and Testing\n\nFor local development, testing, and contributing to Docker support, see the [Docker README](./docker/README.md).\n\n## 📄 How `docs-to-pdf` works\n\n1. [puppeteer](https://pptr.dev/) can make html to PDF like you can print HTML page in chrome browser\n2. so, the idea of docs-to-pdf is **generating one big HTML through looping page link, then run [`page.pdf()`](https://github.com/puppeteer/puppeteer/blob/main/docs/api/puppeteer.page.pdf.md)** from puppeteer to generate PDF.\n\n![docs-to-pdf-diagram](https://user-images.githubusercontent.com/29557494/90359040-c8fb9780-e092-11ea-89c7-1868bc32919f.png)\n\n## 🎉 Thanks\n\nThis repo's code is coming from <https://github.com/KohheePeace/mr-pdf>.\n\nThanks for awesome code made by [@KohheePeace](https://github.com/KohheePeace/), [@maxarndt](https://github.com/maxarndt) and [@aloisklink](https://github.com/aloisklink).\n\n[@bojl](https://github.com/bojl) approach to make TOC was awesome and breakthrough.\n\n## 🤝 Contributing\n\nContributions are welcome! Please read our [Contributing Guide](./CONTRIBUTING.md) for details on:\n\n- Setting up the development environment with [mise](https://mise.jit.su/)\n- Running tests and linting\n- Docker development and E2E testing\n- Commit message conventions (Conventional Commits)\n- Release process (automated via release-please-action)\n\nFor AI assistants working on this project, see [CLAUDE.md](./CLAUDE.md) for specific guidelines.\n","readmeFilename":"README.md"}