10-09-2020, 01:42 PM | #31 | |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
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. |
|
07-01-2021, 03:23 PM | #32 |
Junior Member
Posts: 4
Karma: 80
Join Date: Mar 2021
Device: PocketBook Touch HD 3
|
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"> Code:
{ "tag": "span", "attribute": "role", "value": "doc-pagebreak" } 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 |
Advert | |
|
07-01-2021, 04:18 PM | #33 |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
|
05-21-2022, 10:49 AM | #34 |
Junior Member
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
|
Hello, I tried your plugin on an epub I have. The <pageList> section is getting added to the ncx file but is empty. Here is what is getting added to my ncx file (python modified slightly to match existing file indentation):
Code:
<pageList> <navLabel> <text>Paper Edition Page Mapping</text> </navLabel> </pageList> Code:
<span epub:type="pagebreak" title="Page_8" id="Page_8" class="page-number" xmlns:epub="http://www.idpf.org/2007/ops">Page 8</span> Thoughts? |
05-21-2022, 11:40 AM | #35 |
Sigil Developer
Posts: 8,076
Karma: 5450184
Join Date: Nov 2009
Device: many
|
If epub3, the pagelist should be written to the nav.
|
Advert | |
|
05-21-2022, 12:26 PM | #36 | |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
|
|
05-21-2022, 12:36 PM | #37 | |
Junior Member
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
|
Quote:
I can understand python just enough to recognize data structures and follow the logic, but only just. If I had more time I might be able to understand better what you are using. Probably would help better if I were more familiar with Python library functions |
|
05-21-2022, 03:02 PM | #38 | |
Junior Member
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
|
Quote:
My ebook uses "Page_x" for its anchor points so I needed to do a quick find/replace in the <pageList> section to remove the "Page_" from the <text> tags. Thank you so much |
|
05-21-2022, 03:07 PM | #39 |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
I've attached an updated plugin version to the first post.
However, since the plugin will use the title attribute value instead of the string value by default, it'll write the following page list entry to the NCX file: Code:
<pageTarget id="Page_8" type="normal" value="Page_8"> <navLabel> <text>Page_8</text> </navLabel> <content src="Text/Section0001.xhtml#Page_8"/> </pageTarget> Code:
# 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 Code:
# title has priority over string title = page_number.string BTW, page list entries in Epub2 NCX files are usually ignored by Epub2 apps. The plugin only adds them, because some some Calibre converters will use them. (Epub3 apps only use the NAV pagelist entries.) |
Tags |
pagelist, pagelist generator |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chapter Page Numbers Instead of Title Page Numbers | TheArtfulDodger | Devices | 1 | 11-18-2013 01:08 PM |
Kindle (AZW3/MOBI) ebooks with "real page numbers" to PDF with same page numbers? | abvgd | Conversion | 2 | 05-24-2013 01:24 PM |
Index containing page no. with links - <pagelist> problem | mr10463 | Sigil | 7 | 05-21-2013 07:27 AM |
Print page range in viewer outputs single empty page | larzeb | Library Management | 2 | 04-30-2013 05:24 AM |
Is there a hack for displaying page numbers rather than location numbers? | nesler | Kindle Developer's Corner | 16 | 02-15-2011 12:00 AM |