Skip to content

lufengd3/htmlbook2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local Dev

GitBookPDFSpider.create({
  // replace target gitbook url & name
  url: 'https://braydie.gitbooks.io/how-to-be-a-programmer/content/en/',
  bookName: 'How to be a programer.pdf'
}).then(spider => {
  spider.run();
});
node ./gitbook.js

Generate PDF on Playwright Playground

  1. Copy gibook.js content
  2. open playwright playground: https://try.playwright.tech/?e=generate-pdf
  3. replace GitBookPDFSpider.create config

spider.run internal process

  1. get all chapter links
  2. fetch all chapters html content
  3. beautify page, remove header and sidebar menu etc.

try to modify SITE_CONFIG to adapt to different gitbook site structure.

About

GitBook to PDF

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published