@whyun/vuepress-plugin-pdf-export

1.2.0 • Public • Published

@whyun/vuepress-plugin-pdf-export

Vuepress plugin for exporting site as PDF. Forkend form @snowdog/vuepress-plugin-pdf-export.

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)
  • filter - function for filter pages (default false)
  • sorter - function for changing pages order (default false)
  • outputFileName - name of output file (default site.pdf)
  • puppeteerLaunchOptions - Puppeteer launch options object (default {})
  • pageOptions - Puppeteer page formatting options object (default {format: 'A4'})

Usage

Using this plugin:

// in .vuepress/config.js
module.exports = {
  plugins: ['@snowdog/vuepress-plugin-pdf-export']
}

Then run:

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

module.exports = {
  plugins: [
    ['@snowdog/vuepress-plugin-pdf-export', {
      puppeteerLaunchOptions: {
        args: ['--no-sandbox', '--disable-setuid-sandbox']
      }
    }]
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i @whyun/vuepress-plugin-pdf-export

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

9.12 kB

Total Files

12

Last publish

Collaborators

  • whyun-master