Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 747 Bytes

README.md

File metadata and controls

28 lines (22 loc) · 747 Bytes

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.