• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    CSS
  • License
    MIT License
  • Created about 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

repository to pdf

repo-to-pdf

npm npm

Make pdf from source code

Here is a sample

Install

npm install repo-to-pdf

Usage

Basic

npx repo-to-pdf [src/folder]

All options

-d, --device [platform]
device [desktop(default)|mobile|tablet]
# npx repo-to-pdf ../repo -d mobile

-t, --title [name]
pdf filename
# npx repo-to-pdf ../repo -t MeinKampf.pdf

-w, --whitelist [wlist]
file format white list, split by ","
# npx repo-to-pdf ../repo -w js,md

-s, --size [size]
pdf file size limit, in MB, default 10 MB
# npx repo-to-pdf ../repo -s 10

-r, --renderer [node|calibre]
use either node(relaxedjs) or calibre to render ebook, node outputs pdf, calibre outputs pdf, mobi, epub
# npx repo-to-pdf ../repo -r calibre

-f, --format [pdf|mobi|epub]
output format, either pdf, mobi, epub. mobi and epub are generated using calibre ebook-convert
# npx repo-to-pdf ../repo -f mobi

-c, --calibre [path]
path to ebook-convert, for MacOS, try /Applications/calibre.app/Contents/MacOS/ebook-convert; for linux, try /usr/bin/ebook-convert
For tablet, mobile
npx repo-to-pdf [src/folder] --device tablet
npx repo-to-pdf [src/folder] --device mobile

Testing

npm run test