Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-15-2015, 12:47 PM   #1
Doitsu
Wizard
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: 3,888
Karma: 10764058
Join Date: Dec 2010
Device: Kindle PW2
Pagelist plugin for print edition page numbers

[Plugin] PageList - Generates print edition page numbers

Updated: December 22, 2015
Current Version: "0.1.2"

This plugin will generate NCX pagelist sections from page targets defined using the following special span tags:

Code:
<span epub:type="pagebreak" id="page1" title="1"/>
or
Code:
<span epub:type="pagebreak" id="page1">1</span>
(Both span types can have additional class attributes and the second variant can also have a title attribute.)

Since the epub:type attribute is an ePub3 extension, you'll need to change the html declaration of all .xhtml files with page targets in them as follows, if you want to use the Book View mode in Sigil.

Code:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
Note that with this change in place the ePub will no longer pass ePubCheck. I.e., you'll either need to remove all epub:type attributes and the ops html declarations after the pagelist section was generated or convert it to an ePub3 with KevinH's epub3 plugin. (KevinH's plugin will automatically convert epub2 NCX pagelists to epub3 NAV pagelists.)

Installation:

If you're using Sigil 0.9.0 or higher, select Use Bundled Interpreter and install the attached .zip file.

If you're using an older Sigil version you'll need to install either Python 2 or Python 3 and beautifulsoup4.

To install beautifulsoup4 open an admin command prompt and enter the following commands:

Code:
pip install beautifulsoup4
(You might have to change the directory to C:\PythonXX\Scripts before running pip.)

To install the plugin open Sigil and select:

Plugins > Manage Plugins > Add Plugin > PageList_v0.1.2.zip > OK.

Usage:

To run the plugin select:

Plugins > Edit > PageList > Start.

Note that this plugin will overwrite existing pagelist sections without warning. I.e., you might want to create a backup of your ebook before running this plugin.

After the pagelist was generated, you can test it with iBooks or Azardi (Windows/OSX/Linux freeware). (You could also compile the ePub with Kindle Previewer/KindleGen, generate an .apnx file with KindleUnpack and test the ebook with an eInk Kindle. However, the Kindle page display might be off by a page.)

Note that Azardi doesn't support the first, empty span declaration. It also apparently ignores the pagelist section. It's therefore not ideal for testing, but better than nothing.

If you're using the second, non-empty span version, you'll probably need to hide the page number via CSS. The good folks at the IDPF used the following method for their ePub3 sample files:

Code:
@namespace epub "http://www.idpf.org/2007/ops";

/* more CSS rules */

*[epub|type='pagebreak'] { display: none; }
This CSS rule will hide the page number in ADE3* or higher, iBooks and Azardi, however, KindleGen will ignore it. You may want to use the empty span variant instead, because if you hide the page number span with display: none, KindleGen won't generate a pagemap.

BTW, page number target spans can be easily inserted with a clip.

1. Press Ctrl+Alt+C to open the Clip Editor.
2. Create a new clip and name it, for example, page-break.
3. Copy the following text to the Text field of the page-break clip:
Code:
<span epub:type="pagebreak" id="page\1">\1</span>
4. Save the clip and close the Clip Editor.

Then enter the page number in the Code View window, highlight it, right-click it and select Clips > page-break.

* Even ADE4 still doesn't support pagelists in ePub3 books.

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip PageList_v0.1.2.zip (1.8 KB, 419 views)

Last edited by Doitsu; 08-16-2017 at 03:10 AM. Reason: New version with autostart enabled (Sigil 0.9.3+ required)
Doitsu is offline   Reply With Quote
Advert
Old 09-15-2015, 12:58 PM   #2
KevinH
Wizard
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: 2,545
Karma: 772404
Join Date: Nov 2009
Device: many
Hi Doitsu,

Nice addition! I have added this to the Sigil Plugin Index thread.

KevinH
KevinH is offline   Reply With Quote
Old 09-24-2015, 03:24 PM   #3
radius
Lector minore
radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.radius ought to be getting tired of karma fortunes by now.
 
radius's Avatar
 
Posts: 530
Karma: 1544726
Join Date: Jan 2008
Device: Sony PRS-T3 and 505, Amazon Kindle PaperWhite 2, HTC Nexus 9
Quote:
Originally Posted by Doitsu View Post
After the pagelist was generated, you can test it with iBooks or Azardi (Windows/OSX/Linux freeware). (You could also compile the ePub with Kindle Previewer/KindleGen, generate an .apnx file with KindleUnpack and test the ebook with an eInk Kindle. However, the Kindle page display might be off by a page.
Can you explain the bolded part? It sounds like you are saying that kindleunpack will extract a .apnx file out of a Kindle book created with kindlegen (that was in turn, originally an epub that had your plugin run on it).

However, in the past when I've run kindleunpack I don't recall getting the .apnx, and in any case I thought it was a separate file that goes alongside any .mobi and isn't included inside it (ie: how would kindleunpack extract a file that wasn't inside in the first place).

I know I must be misunderstanding something somewhere
radius is offline   Reply With Quote
Old 09-24-2015, 03:32 PM   #4
KevinH
Wizard
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: 2,545
Karma: 772404
Join Date: Nov 2009
Device: many
Hi,
Kindlegen stores the info to create a separate apnx file inside the mobi it creates. Recent versions of KindleUnpack can extract it and even read in external apnx files alongside the azw3 file.

KevinH
KevinH is offline   Reply With Quote
Old 09-24-2015, 05:28 PM   #5
Doitsu
Wizard
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: 3,888
Karma: 10764058
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by radius View Post
It sounds like you are saying that kindleunpack will extract a .apnx file out of a Kindle book created with kindlegen (that was in turn, originally an epub that had your plugin run on it).
KindleUnpack will generate an .apnx file, if the source file contained either a valid pagelist or a pagemap and was compiled with KindleGen. (Since pagemaps are an Adobe extension and'll cause epubs to fail epubcheck, I decided to generate only pagelists with the plugin.)

BTW, if you plan to add "real page numbers" to a self-published KDP book, you can save yourself the hassle, because, AFAIK, Amazon won't generate APNX files for self-published books, unless the author also published a print edition (with "real page numbers").
Doitsu is offline   Reply With Quote
Advert
Old 12-23-2015, 10:10 AM   #6
polizoto
Junior Member
polizoto began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2015
Device: iPhone, iBooks, EPUB3
After using the page-list plug in and then exporting to EPUB3 with EPUB3-itizer, I am still not getting the list of page numbers in my TOC. Any thoughts?
polizoto is offline   Reply With Quote
Old 12-23-2015, 10:34 AM   #7
Doitsu
Wizard
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: 3,888
Karma: 10764058
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by polizoto View Post
After using the page-list plug in and then exporting to EPUB3 with EPUB3-itizer, I am still not getting the list of page numbers in my TOC. Any thoughts?
If you've used the latest version of the epub3 plugin, the page list section will be automatically hidden via css.

If nav.xhtml actually contains a page-list section, locate the style section and delete the page-list id marked in Magenta:

Code:
    <style type="text/css">
    nav#landmarks, nav#page-list { display:none; }
    ol { list-style-type: none; }
    </style>
Note that some ePub3 apps, e.g. Azardi, actually ignore the nav page-list section and won't display page numbers unless they've been marked using the following syntax:

Code:
<span epub:type="pagebreak" id="page1">1</span>
Other ePub3 apps won't display pagebreak page numbers in the book at all.

What app did you use for testing? If you used iBooks you'll need to activate the page number display, because they're hidden by default.
Doitsu is offline   Reply With Quote
Old 12-23-2015, 11:03 AM   #8
polizoto
Junior Member
polizoto began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2015
Device: iPhone, iBooks, EPUB3
I am testing with Readium and iBooks. I removed the page-list id from the nav.xhtml file.

I can see the page numbers that correspond with the chapters and sections of my ebook, but what I would like to do is have ALL the page numbers-- corresponding to chapter or section headings or not-- displayed for easier navigation. With which readers can this be accomplished?
polizoto is offline   Reply With Quote
Old 12-23-2015, 11:13 AM   #9
polizoto
Junior Member
polizoto began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2015
Device: iPhone, iBooks, EPUB3
Here's what I am trying to accomplish:

1) Mark up all of the original page numbers from a textbook in my EPUB project
2) Export to EPUB3 with all the original page numbers in the TOC
3) The student can use the TOC in the EPUB3 player to navigate directly to the each original page in the textbook

Thank you,

Joseph
polizoto is offline   Reply With Quote
Old 12-23-2015, 12:02 PM   #10
Doitsu
Wizard
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: 3,888
Karma: 10764058
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by polizoto View Post
[...] what I would like to do is have ALL the page numbers-- corresponding to chapter or section headings or not-- displayed for easier navigation. With which readers can this be accomplished?
Unfortunately, I don't know any reader that offers this feature.
Doitsu is offline   Reply With Quote
Old 12-24-2015, 08:36 AM   #11
AlPe
Digital Amanuensis
AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.AlPe ought to be getting tired of karma fortunes by now.
 
AlPe's Avatar
 
Posts: 723
Karma: 1440161
Join Date: Dec 2011
Location: Venice, Italy
Device: Several eReaders and tablets
@Doitsu : I think that what @polizoto wants is to have the page numbers appear in the ToC as well. This way the resulting EPUB can cope with the lack of support for (proper) page-list in real-world apps.

For example, you can put them as children of the corresponding main ToC entry:

Code:
ToC
  - Cover
  -- 1
  - Preface
  -- 2
  -- 3
  - Introduction
  -- 4
  -- 5
  -- 6
  -- 7
  - First Chapter
  -- 8
  -- 9
  -- ...
Albeit against the "official blessings" of the IDPF, I think it would be an idea worth exploring, at least as an option in your plugin --- I guess it would not be too difficult for you to implement it, given you have all the machinery in place.

(Not sure how to deal with number gaps, or if collapsing ranges would work. These might be user options.)
AlPe is offline   Reply With Quote
Old 12-24-2015, 08:50 AM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 17,029
Karma: 89654632
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
As useful as it might seem, I think it would be terribly unwieldy. Trying to navigate a ToC with a link to every, single page number would take me longer than just jumping to the right chapter and then nudging the progress slider 'til I get the right page-number.
DiapDealer is offline   Reply With Quote
Old 12-24-2015, 09:30 AM   #13
Doitsu
Wizard
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: 3,888
Karma: 10764058
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by DiapDealer View Post
As useful as it might seem, I think it would be terribly unwieldy.
I also think that it'd be a bit unwieldy, but might be useful for debugging purposes. I might add it as an optional option.

@polizoto: ADE 4.x apparently allows you to click page target hyperlinks.

Last edited by Doitsu; 12-24-2015 at 10:56 AM.
Doitsu is offline   Reply With Quote
Old 12-29-2015, 02:46 AM   #14
polizoto
Junior Member
polizoto began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2015
Device: iPhone, iBooks, EPUB3
Page Number Options

Alberto is correct-- As long as a particular does not support page number navigation separately from the TOC (like Azardi or Gitden Reader), I would like to provide all the page numbers in the TOC, if possible. This feature would be important in my workflow since I am preparing books for the blind and visually impaired for whom quick navigation via the TOC or another landmark screen + VoiceOver/JAWS is essential, no matter how unwieldy it might seem to us sighted folks. I am surprised that IDPF, which consists of many of the DAISY consortium people, did not keep this fact in mind because EPUB3 has practically meant the death of DAISY, yet all DAISY books contain this feature.

Thanks for the consideration,

Joseph
polizoto is offline   Reply With Quote
Old 12-29-2015, 07:46 PM   #15
Doitsu
Wizard
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: 3,888
Karma: 10764058
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by polizoto View Post
Alberto is correct-- As long as a particular does not support page number navigation separately from the TOC (like Azardi or Gitden Reader), I would like to provide all the page numbers in the TOC, if possible.
Have you tested your ePub3 books with the latest edition of ADE 4.5.x? It allows you to click on page list links (without HTML changes).
(In the Android version, you'll have to select: > Contents ▼ > Page List; in the PC version, you can select the Page List links from the Table Of Contents pane of the main dialog box.)
Doitsu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:21 AM.


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