Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render all section of book #1354

Open
thuynt46 opened this issue Aug 25, 2023 · 6 comments
Open

Render all section of book #1354

thuynt46 opened this issue Aug 25, 2023 · 6 comments

Comments

@thuynt46
Copy link

I really want to find a solution to render all sections of the book. Can you give me some way?

@thuynt46
Copy link
Author

Anyone hereeeeeee

@johnfactotum
Copy link
Contributor

Loop through the sections (using e.g. book.spine.each()) and call section.render() to get the HTML.

@thuynt46
Copy link
Author

@johnfactotum uhm, my idea is rendering all the sections. After that base on location calculate the total page. Is it Is it possible or not? My goal is to calculate totalpage.

@johnfactotum
Copy link
Contributor

Yeah, if you only want to calculate the number of pages, you just render each section and add up location.start.displayed.total.

@thuynt46
Copy link
Author

@johnfactotum Thanks for your answers. I did this. It's working nicely in a book with the book separated into multiple sections. And each section has a page count of less than 50 pages. And it is very slow for books with content each section is about 500 pages large. Is there a way to optimize the calculated total number and render section time?

@johnfactotum
Copy link
Contributor

AFAIK, not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants