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" ],
pathToPublic: "pdf/readme.pdf",
pdfOptions: "<options for puppeteer.pdf()>",
removeTemp: true,
emulateMedia: "screen",
}
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)
🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧🚧
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!