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

PageMap: allow building synthetic pages numbers #478

Merged
merged 1 commit into from
May 5, 2022

Conversation

poire-z
Copy link
Contributor

@poire-z poire-z commented Apr 26, 2022

Add a method (available to frontends) to build a synthetic page map, with a new page number every N chars.
This could allow a frontend to show stable page numbers, that do not change with the rendering.
Initial idea described at koreader/koreader#9020 (comment).

This reuses what was added in #336 and koreader/koreader#6004.
The function to build it is just there, it works, takes a little bit of time to navigate all the text nodes (too complicated to do it as XML parsing time, and most people won't need it, so no need to force doing it here and waste space and memory - people who want it can bear the additional time it takes).

I'm still not sure how/if this could go into KOReader's menu and settings - but well, let's have this code available so the interested people can experiment.


This change is Reviewable

Add a method (available to frontends) to build a synthetic
page map, with a new page number every N chars.
This could allow a frontend to show stable page numbers, that
do not change with the rendering.
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

Successfully merging this pull request may close these issues.

None yet

1 participant