https://github.com/snowdogapps/vuepress-plugin-pdf-export
Vuepress plugin for exporting as PDF without system wide dependencies suitable for headless environments
https://github.com/snowdogapps/vuepress-plugin-pdf-export
hacktoberfest pdf vuepress-plugin
Last synced: 21 days ago
JSON representation
Vuepress plugin for exporting as PDF without system wide dependencies suitable for headless environments
- Host: GitHub
- URL: https://github.com/snowdogapps/vuepress-plugin-pdf-export
- Owner: SnowdogApps
- License: mit
- Created: 2020-03-18T18:53:31.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-20T15:47:36.000Z (almost 3 years ago)
- Last Synced: 2024-11-03T08:46:47.439Z (6 months ago)
- Topics: hacktoberfest, pdf, vuepress-plugin
- Language: JavaScript
- Size: 125 KB
- Stars: 29
- Watchers: 5
- Forks: 7
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @snowdog/vuepress-plugin-pdf-export
Vuepress plugin for exporting site as PDF## Features
- Exports whole Vuepress based page as a single PDF file
- Applies styles to hide UI elements like navigation or sidebar
- Doesn't require other runtimes like Java to operate
- Designed to work well in headless environments like CI runners## Config options
- `theme` - theme name (default `@vuepress/default`)
- `sorter` - function for changing pages order (default `false`)
- `outputFileName` - name of output file (default `site.pdf`)
- `puppeteerLaunchOptions` - [Puppeteer launch options object](https://github.com/puppeteer/puppeteer/blob/v2.1.1/docs/api.md#puppeteerlaunchoptions) (default `{}`)
- `pageOptions` - [Puppeteer page formatting options object](https://github.com/puppeteer/puppeteer/blob/v2.1.1/docs/api.md#pagepdfoptions) (default `{format: 'A4'}`)### Usage
Using this plugin:
``` js
// in .vuepress/config.js
module.exports = {
plugins: ['@snowdog/vuepress-plugin-pdf-export']
}
```Then run:
``` bash
vuepress export [path/to/your/docs]
```### Tips
To run this plugin on Gitlab CI you may want to run Chrome with `no-sandbox` flag. [Details](https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#setting-up-chrome-linux-sandbox)```js
module.exports = {
plugins: [
['@snowdog/vuepress-plugin-pdf-export', {
puppeteerLaunchOptions: {
args: ['--no-sandbox', '--disable-setuid-sandbox']
}
}]
]
}
```