MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   Pagelist plugin for print edition page numbers (https://www.mobileread.com/forums/showthread.php?t=265237)

Doitsu 10-09-2020 02:42 PM

Quote:

Originally Posted by Terry Brown (Post 4045153)
Is there something else I need to do to make the page numbers show up?

AFAIK, printed page numbers only work in epub3 books. If your book is an epub2 book, you'll have to convert it to an epub3 book with the ePub3-itizer plugin.

If your book is an epub3 book, maybe the pagelist section in the Nav doc is missing, doesn't contain pagelist entries or the page number definitions point to the wrong target ids.

You might want to check your book with my EPUBCheck plugin, if you haven't already done so.

If EPUBCheck doesn't report any broken links, download this very simple MR epub3 book with a working pagelist section and compare the pagelist section and the page target definitions with your book.

tastytea 07-01-2021 04:23 PM

Hi, thanks for your plugin!
I have a book that records page numbers like this:
Code:

<span role="doc-pagebreak" id="pg_13" aria-label="13">
Changing PageList.json to:
Code:

{
  "tag": "span",
  "attribute": "role",
  "value": "doc-pagebreak"
}

did not suffice, I also had to change plugin.py like this:
Code:

diff --git a/plugin.py b/plugin.py
index 9bf6b68..26a6863 100644
--- a/plugin.py
+++ b/plugin.py
@@ -143,6 +143,8 @@ def run(bk):
            # title has priority over string
            if page_number.has_attr('title'):
                title = page_number['title']
+            elif page_number.has_attr('aria-label'):
+                title = page_number['aria-label']
            else:
                title = page_number.string

Could you add that to your plugin?

Doitsu 07-01-2021 05:18 PM

Quote:

Originally Posted by tastytea (Post 4135287)
Could you add that to your plugin?

Thanks for the suggestion! I added the two lines to plugin.py and attached a new version to the first post.


All times are GMT -4. The time now is 07:06 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.