View Single Post
Old 09-15-2015, 12:47 PM   #1
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,255
Karma: 19618389
Join Date: Dec 2010
Device: Kindle PW2
Pagelist plugin for print edition page numbers

[Plugin] PageList - Generates print edition page numbers

Updated: July 1, 2021
Current Version: "0.3.1"

This plugin will generate NAV page list and/or NCX page list 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.)

You can also manually edit the PageList.json file to have the plugin search for class attributes. For example, if you want to use the following span attributes:

Code:
<span class="com-rorohiko-pagestaker-style">1</span>
you'll need to use change the following entries in PageList.json:
Code:
{
  "tag": "span",
  "attribute": "epub:type",
  "value": "pagebreak"
}
to
Code:
{
  "tag": "span",
  "attribute": "class",
  "value": "com-rorohiko-pagestaker-style"
}
PageList.json will be automatically created when you run the plugin for the first time.
To display the PageList preferences folder, select Edit > Preferences > Open Preferences Location > plugins_prefs > PageList.

Installation:

To install the plugin open Sigil and select:

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

Usage:

To run the plugin select:

Plugins > Edit > PageList.

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 page list was generated, you can test it with Apple Books or Azardi (Windows/OSX/Linux freeware).

Note that Azardi doesn't support the first, empty span declaration. It also apparently ignores the page list section. It's therefore not ideal for testing.

If you're using the second, non-empty span version, you might want to use the following style in epub3 books to hide the page number:

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, Apple Books 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 page lists in ePub3 books.

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip PageList_v0.3.1.zip (7.4 KB, 153 views)

Last edited by Doitsu; 07-01-2021 at 04:20 PM. Reason: Updated version attached
Doitsu is offline   Reply With Quote