Giter Club home page Giter Club logo

vuepress-plugin-export's Introduction

vuepress-plugin-export

NPM version NPM downloads

This plugin requires VuePress >= 1.0.0-alpha.44.

Features

  • Merge all of your pages automatically.

TODO

  • Support default and confurable front cover.
  • Inject Table of Contents.
  • Inject Page Numbers.
  • Generate different PDF files per locale.
  • Transform all of links.

Install

npm i vuepress-plugin-export

Usage

Using this plugin:

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

Then run:

vuepress export [path/to/your/docs]

Generating multiple output files

You can configure this plugin to export multiple files. Add config options:

module.exports: ['vuepress-plugin-export', {
  theme: '@vuepress/default',
  puppeteer: { args: ['--no-sandbox'] },
  bundles: [{
    filter: (location) => !location.includes('export'),
    dest: () => 'docs/public/export.pdf',
  }, {
    filter: /\/en\///,
    dest: (siteConfig) => `docs/public/${siteConfig.title}.en.pdf`,
  }]
}]

Then run:

vuepress export [path/to/your/docs]

Config options

  • theme: String
  • puppeteer: Object
  • bundles: Array | Function(Array[PageConfig]) => Array[bundle]
  • bundles[].filter: RegExp | Function(location: string, page: PageConfig) => boolean
  • bundles[].dest: (config: VuepressPluginConfig(https://vuepress.vuejs.org/config/#basic-config)) => string
  • bundles[].sorter: Function(PageConfig, PageConfig) => -1, 0, 1

with PageConfig:

url: string
location: string
title: string
path: string

Development

git clone https://github.com/ulivz/vuepress-plugin-export
cd vuepress-plugin-export
yarn
yarn export

Note that this package is powered by puppeteer, if you are in a mysterious wall, consider setting environment variables before installation.

PUPPETEER_DOWNLOAD_HOST=https://npm.taobao.org/mirrors

Note that this pavkage is powered by easy-pdf-merge, Java 6 or higher must be present.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

vuepress-plugin-export © ULVIZ, Released under the MIT License.
Authored and maintained by ULVIZ with help from contributors (list).

github.com/ulivz · GitHub @ULVIZ · Twitter @_ulivz

vuepress-plugin-export's People

Contributors

chunksnbits avatar sullivanpt avatar ulivz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.