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
- Copy gibook.js content
- open playwright playground: https://try.playwright.tech/?e=generate-pdf
- replace GitBookPDFSpider.create config
- get all chapter links
- fetch all chapters html content
- beautify page, remove header and sidebar menu etc.
try to modify SITE_CONFIG to adapt to different gitbook site structure.