Skip to content

Add support for navigation following content.opf in epub files#71

Closed
gonwan wants to merge 1 commit into
eBookProjects:masterfrom
gonwan:epub-navigation2
Closed

Add support for navigation following content.opf in epub files#71
gonwan wants to merge 1 commit into
eBookProjects:masterfrom
gonwan:epub-navigation2

Conversation

@gonwan

@gonwan gonwan commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #37.

Use attachment for testing. There are 3 TOC and 10 pages in the file. Use previous/next button in toolbar to view 'hidden' pages. The file in #37 also works.

To make things easy, 'hidden' pages are associated with a last known TOC entry. When click previous/next button, first check 'hidden' pages before/after the current one, then pages in TOC before/after it.

Two pass to construct the TOC data structure for epub files: In first pass, construct TOC using toc.ncx. In second pass, associate pages in content.opf but not in toc.ncx to TOC data structure.

BTW, it's really hard to be 100% compliant with astyle convention. The whole file got re-formatted after running the tool, which involves incorrect/unintended changes.

testepub.zip

@gonwan gonwan closed this Jan 23, 2026
@u-235

u-235 commented Jan 23, 2026

Copy link
Copy Markdown
Member

BTW, it's really hard to be 100% compliant with astyle convention. The whole file got re-formatted after running the tool, which involves incorrect/unintended changes.

I'm using Astyle version 3.4 (if I'm not mistaken), built from source because later versions had some strange bugs. I tried configuring clang-format, but I got confused by the many options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

EPUB: Previous/Next buttons should follow content.opf, not toc.ncx

2 participants