htmlbook2pdf icon indicating copy to clipboard operation
htmlbook2pdf copied to clipboard

Cannot make use of the gitbook.js file

Open Lumerica opened this issue 1 year ago • 8 comments

Hello, I tried to use the your instruction as I am trying to save a gitbook link. but I get the following error.

image

Lumerica avatar Oct 08 '24 21:10 Lumerica

update chapterLinksElmSelector: 'body > div > div > aside > div > ul a', in gitbook.js

DevTech15 avatar Oct 10 '24 08:10 DevTech15

I tried that, but ending up in a loop for https://docs.facefusion.io.

henryruhs avatar Oct 10 '24 09:10 henryruhs

can you try this https://github.com/AhmadManzoor/gitbook-exporter

DevTech15 avatar Oct 10 '24 11:10 DevTech15

@AhmadManzoor works but the output looks not that good - basic typo like headlines are missing

henryruhs avatar Oct 11 '24 08:10 henryruhs

i believe it is generating headlines. YOu can tweak the code according to your needs

DevTech15 avatar Oct 11 '24 10:10 DevTech15

@Lumerica @henryruhs docs.facefusion.io html structure is different from legacy gitbook, we have to modify the selectors, try this https://github.com/lufengd3/htmlbook2pdf/blob/main/gitbook.js#L24

const SITE_CONFIG = {
  chapterLinksElmSelector: 'body > div > div > aside > div > ul a',
  bookContentSelector: 'main',
  headerSelector: 'header',
}

lufengd3 avatar Oct 11 '24 12:10 lufengd3

Does not work, again infinity loops.

henryruhs avatar Oct 11 '24 13:10 henryruhs

Does not work, again infinity loops.

works for me 1 59efec85-a13d-485a-a457-96b8f6fd425f.pdf

lufengd3 avatar Oct 12 '24 00:10 lufengd3