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

Adds ReaderPageMap, to optionally show source pages numbers #6004

Merged
merged 3 commits into from
Mar 27, 2020

Conversation

poire-z
Copy link
Contributor

@poire-z poire-z commented Mar 26, 2020

bump crengine: support for EPUB3 nav toc and page maps
Includes koreader/crengine#336

Adds ReaderPageMap which will add a new menu (under TOC and Bookmarks) that will allow:

  • to list source page numbers (like a TOC)
  • to show visible page labels in the right margin
  • to use these source page numbers in the footer, the TOC, the GoTo and SkimTo widgets, and to use the source page number in the standard bookmark and highlight initial text.
  • (and to unwontfix and close Epub page numbers #4521)

It will not be often used (less than 5% of my publishers' EPUB have a page map/list), and most people will probably disable it when it appears, as it's rarely useful. It's just nice to have (for when you see in a book "See note page 48" and that references the hardcopy book, with no internal link to that note in the EPUB).

So, we'll get this (only when there is a pagemap in the book):
image image
image
An option to use the source/hardcopy page number in the footer, TOC, Bookmark names, Goto and SkimTo widgets:
image
and one to show the page labels in the margin:
image

Opinions and suggestions welcome on the wording in the screenshots above for this feature and these page maps/lists I used "Source pages" because I'm not sure it's always reference to hardcopy paper book pages, but I dunno...

(still need to include the bump for koreader/koreader-base#1070)

Also include:
BookInfo: add File date, handle zip sub-suffix (.fb2.zip) , as mentionned in #5956 (comment)

Also include koreader/koreader-base#1068: Update OpenSSL to 1.1.1e Update OpenSSH to 8.2p1


This change is Reviewable

@Frenzie Frenzie added this to the 2020.04 milestone Mar 26, 2020
Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-ref to #4245, #3833.

hold_callback = function(touchmenu_instance)
local use_page_labels = G_reader_settings:isTrue("pagemap_use_page_labels")
UIManager:show(MultiConfirmBox:new{
text = use_page_labels and _("The default (★) for newly opened books that have a page map is to use these page labels instead of the renderer page numbers.\n\nWould you like to change it?")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not ecstatic about "renderer page numbers" but atm I can't think of a good alternative.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this one was hard.
I wanted to have the buttons "Renderer pages" | "Source pages (★)" but these got truncated...
So, we could end up with a sentence and Disable | Enable.

@poire-z poire-z force-pushed the bump_crengine_pagemap branch 3 times, most recently from ceb0ecf to 08304e4 Compare March 26, 2020 16:29
@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

So, no particular thought against calling that/them "Source pages" ?

@Frenzie
Copy link
Member

Frenzie commented Mar 26, 2020

Oh, I don't like that one bit. :-P

What about something along the lines of basic page numbers and advanced page numbers?

@NiLuJe
Copy link
Member

NiLuJe commented Mar 26, 2020

Reference page number?

Or, let's finally call it what it actually is instead of a stupid skeuomorphism: screen number vs. page number?

@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

Or, let's finally call it what it actually is instead of a stupid skeuomorphism: screen number vs. page number?

No, our page numbers are page numbers - renderer page numbers.
And most books won't have that menu - and we won't switch all the naming to mention "screen page numbers" :)
So, it's these source/reference/hardcopy page numbers that need the qualification/adjective.

basic page numbers and advanced page numbers

None of each is either basic or advanced. These "source page numbers", althought sometimes useful, are more bothering (jumps, gaps, multiples consecutive on the same screen page...)

Reference page number?

That could work I guess.

@NiLuJe
Copy link
Member

NiLuJe commented Mar 26, 2020

No, our page numbers are page numbers - renderer page numbers.

But isn't a renderer page number technically one screen's height?

@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

Yes, technically, in page mode, we show one page per screen :) (even more technically, and out of this context, pages can be smaller than a screen height, with page breaks between chapters - so, when switching to scroll mode, you can have 2 or 3 renderer pages in the screen view).

Just insisting I'd like to keep these ones called simply "page numbers" :)

@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

Better ?:
image image

(And where "page" should be plural, "pages" or not? Reference pages label?)

@NiLuJe
Copy link
Member

NiLuJe commented Mar 26, 2020

Plural mark on the rightmost noun of a compound is correct ;).

EDIT: Here, there's technically always one label per page, so we're concerned with labels, not pages.

@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

What about "Reference page list" vs "Reference pages list" ?

@NiLuJe
Copy link
Member

NiLuJe commented Mar 26, 2020

It's a single list of reference page numbers? (I'd tend to prefer adding an explicit 'number' mentioned somewhere there, so Reference page numbers list?)

@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

image

The Use reference page numbers is a bit obtuse... It's supposed to mean "use reference page numbers instead of renderer page numbers where it might make sense" :) and it's not super perfectly implemented (in the SkimTo widget, it will show the ref page number as the number, it will allow you to input it in the GoTo input (including page numbers in latin like xvii - but taping on +10 or -1 will skip you 10 or -1 rendered pages... but well, I'll fix that when someone complain :)

@Frenzie
Copy link
Member

Frenzie commented Mar 26, 2020

None of each is either basic or advanced. These "source page numbers", althought sometimes useful, are more bothering (jumps, gaps, multiples consecutive on the same screen page...)

By basic I mean 1-99 without Latin, letters or whatever. As such we have some slight miscommunication here in that you can have "advanced" page numbers perfectly fine without jumps or gaps.

Anyway, I said along the lines of for a reason. ^_^ I don't literally mean the word advanced. I mean the general concept or association of advanced, complete, proper, thorough, paper-like, etc.

Or, let's finally call it what it actually is instead of a stupid skeuomorphism: screen number vs. page number?

In paged media the distinction isn't between screens and pages but in the fact that page 1 doesn't start till page 20, before that it's page i-ixx, a-p, or whatever. That's basically my angle here. Dumb/basic Arabic page numbers vs labeled page numbers. Ideally the phrasing is compatible with both labeled paper-like page numbers in EPUB and labeled DjVu/PDF page names/numbers.

We can also do it (partially) without words, something like

  • Page number format: 1-99
  • Page number format: labeled

@Frenzie
Copy link
Member

Frenzie commented Mar 26, 2020

Screenshot from LibreOffice (not quite applicable, maybe Adobe Reader has a relevant setting):
Screenshot_2020-03-26_21-26-22

@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

But you can have source/reference page numbers that are also 1-99, starting at 1 without any roman numbers, contiguous, increasing with no gap.
Distinguising them by how they look feels artificial. Better by where they come from (renderer vs reference/source/publisher).

(You cross ref'ed the issues with PDF & DJVU page numbers - but I have no idea how/if the code I added could be of use with them - probably simpler as for them, there is a one-to-one mapping between renderer pages vs reference/source page numbers.)

@Frenzie
Copy link
Member

Frenzie commented Mar 26, 2020

But you can have source/reference page numbers that are also 1-99, starting at 1 without any roman numbers, contiguous, increasing with no gap.

What are they called on Kindle or Kobo?

@mergen3107
Copy link
Contributor

mergen3107 commented Mar 26, 2020

In Kindle there are three types of positions.

  1. “Locations” are proprietary Amazon-calculated values, basically like a cumulative sum of all characters on a “page” (current screen). Location step depends on font size
  2. “Pages” are present only if supporting apnx file is provided for this book. This is just “conversion” of how many locations should be in a print version of this book.
  3. “html-positions” which a raw data extracted from the book, but they are only visible in logs, not available for users

@Frenzie
Copy link
Member

Frenzie commented Mar 26, 2020

@poire-z

But you can have source/reference page numbers that are also 1-99, starting at 1 without any roman numbers, contiguous, increasing with no gap.

PS In DjVu/PDF it's often as simple as the cover not being included in numbering.

@mergen3107
Thanks! Sounds like there's nothing of interest to be gained there. ;-)

@poire-z
Copy link
Contributor Author

poire-z commented Mar 26, 2020

What are they called on Kindle or Kobo?

No idea :)

But in the various mobiread links given in #4521:
https://wiki.mobileread.com/wiki/NCX 1 for 1 mapping to the actual page numbers in the physical book
https://wiki.mobileread.com/wiki/Adobe_Digital_Editions#Page-map mapping between the hardcopy book page numbers and the eBook
https://www.mobileread.com/forums/showthread.php?t=243222 the start of the real page in the matching printed book.
https://wiki.mobileread.com/wiki/Page_numbers Absolute page numbers (I don't like it :) The page numbers to be used in eBooks could be aligned with paper book versions of the same book for easy referencing

I'm fine with "Reference", which is a little less absolute than "Absolute" :)

@Frenzie
Copy link
Member

Frenzie commented Mar 26, 2020

I think "page labels" might be clearer than "reference page numbers," but maybe I'm just saying that because of PDF.

text = _("Reference pages"),
sub_item_table ={
{
text = _("Reference source info"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might want to throw in some @translators notes. A reference source just sounds like a dictionary or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, added 2 - feels a bit excessive to add more... Hopefully, translators will meet all of them near each others and will know what it's about.

bump crengine: support for EPUB3 nav toc and page maps
Includes:
- Fix lvRect:isRectInside(rc) with 0-width or 0-height rect
- TOC: parse EPUB3 nav toc, fallback to spine when no toc
- Parse and cache various hardcopy page list maps
- epub.css: hide EPUB3 <span epub:type="pagebreak"> content
cre.cpp: add a few PageMap helper functions.

Adds ReaderPageMap which will add a new menu (under TOC and
Bookmarks) that will allow:
- to list source page numbers (like a TOC)
- to show visible page labels in the right margin
- to use these source page numbers in the footer, the TOC,
  the GoTo and SkimTo widgets, and to use the source page
  number in the standard bookmark and highlight initial text.
Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Successfully merging this pull request may close these issues.

Bookmarks don't work correctly in some rare cases FR: Support EPUB3 navigation document Epub page numbers
4 participants