Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docsify-pdf-converter

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docsify-pdf-converter

A magical pdf generator for docsify projects.

  • 2.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-27.27%
Maintainers
1
Weekly downloads
 
Created
Source

docsify-pdf-converter

Install

npm install --save-dev docsify-pdf-converter

Usage as CLI:

Create:

  • config file .docsifytopdfrc.<js|json|yaml>
  • or "docsifytopdf" field in package.json (like rcfile can receive) with this setup object:

Example .docsifytopdfrc.js content:

module.exports = {
  contents: [ "docs/_sidebar.md" ], // array of "table of contents" files path
  pathToPublic: "pdf/readme.pdf", // path where pdf will stored
  pdfOptions: "<options for puppeteer.pdf()>", // reference: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions
  removeTemp: true, // remove generated .md and .html or not
  emulateMedia: "screen", // mediaType, emulating by puppeteer for rendering pdf, 'print' by default (reference: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageemulatemediamediatype)
}

Add script into package.json:

{
  "scripts": {
    "convert": "node_modules/.bin/docsify-pdf-converter"
  }
}

Run converter:

npm run convert

Usage as npm-package:

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧 This part of module is not safe for work - it will stop process after generation pdf. Use it for your own risk. You can just import and use main function like this:

const converter = require('docsify-pdf-converter');
const config = require('./.docsifytopdfrc.js');

converter(config) // right after resolve or reject inner promise your process will be terminated :C

🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧

Contributing

  • Fork it!
  • Create your feature branch: git checkout -b my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request

Your pull requests and issues are welcome!

Keywords

FAQs

Package last updated on 16 Apr 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc