# docsify-pdf-converter

> A magical pdf generator for docsify projects.

Latest version **2.0.7** (published 2019-04-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install docsify-pdf-converter
pnpm add docsify-pdf-converter
yarn add docsify-pdf-converter
bun add docsify-pdf-converter
```

Provides the commands `converter`, `docsify-pdf-converter`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.7 |
| Published | 2019-04-16 |
| First published | 2019-02-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 91 |
| Author | Ivan Gorbunov |
| Maintainers | meff34 |
| Keywords | docsify, pdf, converter, cli |

## Links

- npm: https://www.npmjs.com/package/docsify-pdf-converter
- Repository: https://github.com/meff34/docsify-to-pdf-converter
- Homepage: https://github.com/meff34/docsify-to-pdf-converter#readme
- Issues: https://github.com/meff34/docsify-to-pdf-converter/issues
- npm.io page: https://npm.io/package/docsify-pdf-converter

## Dependencies (10)

- [yesno](https://npm.io/package/yesno.md) ^0.2.0
- [colors](https://npm.io/package/colors.md) ^1.3.3
- [is-url](https://npm.io/package/is-url.md) ^1.2.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [rcfile](https://npm.io/package/rcfile.md) ^1.0.3
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.3
- [puppeteer](https://npm.io/package/puppeteer.md) ^1.12.2
- [docsify-cli](https://npm.io/package/docsify-cli.md) ^4.3.0
- [find-free-port](https://npm.io/package/find-free-port.md) ^2.0.0
- [markdown-link-extractor](https://npm.io/package/markdown-link-extractor.md) ^1.2.0

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 2.0.7 (latest) — 2019-04-16
- 2.1.0-beta.0 (beta) — 2019-04-16
- 2.0.6 — 2019-04-12
- 2.0.5 — 2019-04-10
- 2.0.4 — 2019-04-07
- 2.0.3 — 2019-04-07
- 2.0.2 — 2019-04-07
- 2.0.1 — 2019-04-07
- 2.0.0 — 2019-04-07
- 1.0.4 — 2019-04-06
- 1.0.3 — 2019-04-06
- 1.0.2 — 2019-02-18
- 1.0.1 — 2019-02-18
- 1.0.0 — 2019-02-13

## README

# docsify-pdf-converter

## Install

```sh
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][rcfile] can receive) with this setup object:

Example `.docsifytopdfrc.js` content:

```js
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`:

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

Run converter:

```sh
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:

```js
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!

[rcfile]: https://www.npmjs.com/package/rcfile

---
_Source: https://npm.io/package/docsify-pdf-converter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
