Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 10-09-2020, 01:42 PM   #31
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Terry Brown View Post
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.
Doitsu is offline   Reply With Quote
Old 07-01-2021, 03:23 PM   #32
tastytea
Junior Member
tastytea has learned how to buy an e-book online
 
tastytea's Avatar
 
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">
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?
tastytea is offline   Reply With Quote
Advert
Old 07-01-2021, 04:18 PM   #33
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by tastytea View Post
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.
Doitsu is offline   Reply With Quote
Old 05-21-2022, 10:49 AM   #34
m8cb0y
Junior Member
m8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipse
 
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>
The ebook already had anchor tags present so I did not modify the json file. Here is an example page number from my ebook:

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>
The plugin is identifying page number targets in the file and has found over 900 targets. However, it is not writing out the details in the pageList.

Thoughts?
m8cb0y is offline   Reply With Quote
Old 05-21-2022, 11:40 AM   #35
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
If epub3, the pagelist should be written to the nav.
KevinH is offline   Reply With Quote
Advert
Old 05-21-2022, 12:26 PM   #36
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by m8cb0y View Post
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>
I was able to reproduce the bug and'll release an updated version soon.
Doitsu is offline   Reply With Quote
Old 05-21-2022, 12:36 PM   #37
m8cb0y
Junior Member
m8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipse
 
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
Quote:
Originally Posted by Doitsu View Post
I was able to reproduce the bug and'll release an updated version soon.
Thank you!

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
m8cb0y is offline   Reply With Quote
Old 05-21-2022, 03:02 PM   #38
m8cb0y
Junior Member
m8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipsem8cb0y can illuminate an eclipse
 
Posts: 4
Karma: 8086
Join Date: Apr 2012
Location: Louisiana
Device: Kobo AuraHD Limited Edition
Quote:
Originally Posted by Doitsu View Post
I was able to reproduce the bug and'll release an updated version soon.
I just tested the updated plugin on my eBook, worked perfectly.

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
m8cb0y is offline   Reply With Quote
Old 05-21-2022, 03:07 PM   #39
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
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>
If you want the plugin to write the string value instead, change the following lines:

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
to:

Code:
            # title has priority over string
            title = page_number.string
(There need to be exactly 12 spaces before each line.)

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.)
Doitsu is offline   Reply With Quote
Reply

Tags
pagelist, pagelist generator


Forum Jump

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


All times are GMT -4. The time now is 11:43 PM.


MobileRead.com is a privately owned, operated and funded community.