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 03-28-2018, 10:45 AM   #31
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DiapDealer...You're right, I did assume that all epubs contain a toc -- my mistake with apologies to both you and KevinH. OK I'll add some code that walks through the ncx and opf looking for hrefs with ids. I think the safest way would be to gather the href ids from both the xhtml files and toc.ncx and just use that as a check list for id removal from the xhtml files.

Last edited by slowsmile; 03-28-2018 at 10:52 AM.
slowsmile is offline   Reply With Quote
Old 03-28-2018, 11:01 AM   #32
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
No problem. It's not always easy seeing the various ways that someone else's garbage can expose the flaws in the workflow of the code you wrote using lovingly cherry-picked test-cases.
DiapDealer is offline   Reply With Quote
Advert
Old 03-28-2018, 11:26 AM   #33
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
Also the ncx can have an actual page table of page numbers and links into the xhtml. These ids are required and are not something that can be removed without breaking the entire page table.
KevinH is offline   Reply With Quote
Old 03-28-2018, 11:41 AM   #34
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
Here is a link to adobe pagemap.xml files that can contain links to ids in xhtml pages in epub2 and to ncx page tables. Various examples can be found by a websearch.

https://www.safaribooksonline.com/bl...-ncx-pagelist/

And here are a few starting point in our own Wiki:

https://wiki.mobileread.com/wiki/Page_numbers
https://wiki.mobileread.com/wiki/Ado...tions#Page-map
https://wiki.mobileread.com/wiki/NCX


And by the way, the sample epub that was just posted by BeckyEbook correctly uses fragments in the opf guide section so parsing the opf guide will be needed as well.

Last edited by KevinH; 03-28-2018 at 11:44 AM.
KevinH is offline   Reply With Quote
Old 03-28-2018, 06:23 PM   #35
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@Kevin...Thanks for providing the links. I admit that I don't know much about Adobe page-maps.

I've read the links that you provided and some of the information surprised me. For instance here is an excerpt from your Safari-O'Reilly link:

Quote:
"The catch? page-map is (intentionally) an extension to ePub and adding a page-map file to your ePub will make it invalid. On top of that, unless the reading systems is based on Adobe software (like Digital Editions and the Sony Reader), page-map will have no effect."
The above emphasized text seems to indicate that if you have Adobe's page-map feature in your epub then it will not pass Epubcheck. So what you are asking me to do is to accomodate and check a proprietary epub feature(page-maps) that invalidates an epub. The page-map feature also only works on ADE and Sony ereaders that obviously use their own proprietary epub standard(not the IDPF epub standard).

Could you please clarify the reasons why I should include checks on page-map links in my plugin. My own view is that I see no point in my plugin supporting Adobe's proprietary page-map feature when that feature invalidates epubs i.e. I would prefer that my plugin properly follows the IDPF standard for epub 2. I should also mention that, in my research on page-maps, Calibre dropped their page-map plugin in 2010 and it was never replaced.

KevinH said:
Quote:
And by the way, the sample epub that was just posted by BeckyEbook correctly uses fragments in the opf guide section so parsing the opf guide will be needed as well.
As I've already reported to Becky, after I ran the IDErrorCheck and RemoveUnusedBookmarks plugins on her epub, it passed Epubcheck without any problems. Nevertheless, I will also check all the href ids in the opf with this plugin as you've advised, just to make sure.

Last edited by slowsmile; 03-28-2018 at 07:24 PM.
slowsmile is offline   Reply With Quote
Advert
Old 03-28-2018, 07:33 PM   #36
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Let users worry about validating their own epubs. If it worked when it was going in and you can prevent breaking it with your plugin, you probably should. Especially something as industry standard as page maps (regardless of their spec-compliance).
DiapDealer is offline   Reply With Quote
Old 03-28-2018, 08:00 PM   #37
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@ DiapDealer...I'm afraid that I strongly object to allowing page-map checks in my plugin because it sets a bad precedent. To me there's no grey area. You either follow one standard like the IDPF standard or you don't.

Here's an example of problems that would arise if you don't follow one standard. Say a Sigil user requests an automatic page-map build feature for Sigil and the developers respond that their request does not follow the IDPF standard and his feature request is refused. And then the user responds by saying that there is a already a Sigil plugin that supports and processes page-maps. How are you going to respond to that user? If the above precedent already exists and allows a Sigil plugin to process page-maps then what possible justification can the Sigil developers have for refusing the user's new page-map build feature request?

From the above, here's another interesting question for you: Should all Sigil plugins follow the same epub standard as the Sigil app?(I would really like an answer to this question)

Last edited by slowsmile; 03-28-2018 at 09:15 PM.
slowsmile is offline   Reply With Quote
Old 03-28-2018, 09:03 PM   #38
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by slowsmile View Post
@ DiapDealer...I'm afraid that I strongly object to allowing page-map checks in my plugin because it sets a bad precedent. To me there's no grey area. You either follow one standard like the IDPF standard or you don't.
Whatever. They're your plugins.

Quote:
Originally Posted by slowsmile View Post
Here's an example of problems that would arise if you don't follow one standard. Say a Sigil user requests an automatic page-map build feature for Sigil and the developers respond that their request does not follow the IDPF standard and his feature request is refused. And then the user responds by saying that there is a already a Sigil plugin that supports and processes page-maps. How are you going to respond to that user?
I'm going to say, "so what?"

Quote:
Originally Posted by slowsmile View Post
If the above precedent already allows a Sigil plugin to process page-maps then what possible justification do the Sigil developers have for refusing the user's new page-map build feature request?
You're being a little obtuse. There's clearly a difference between adding feature requests to Sigil's core and not expecting a plugin to break a working epub. Besides ... Sigil already makes non-spec-complaint concessions to remain compatible with other popular software and popular epub creation techniques. And we certainly try to accommodate the opening of non-compliant epubs without breaking internal links wherever possible. Sigil doesn't blindly dump/drop/break things that don't meet spec.

But I'm done here. If you're comfortable with your plugins breaking people's working epubs because they contained non-spec content, then have at it. I'm more of a "first do no harm" contributor, myself. *shrug*

Last edited by DiapDealer; 03-28-2018 at 09:08 PM.
DiapDealer is offline   Reply With Quote
Old 03-28-2018, 09:32 PM   #39
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DiapDealer...Thanks for your response and for your patience. Just to keep things proper, in my release notes I'll add in a statement in Caveat that states that page-maps are not supported by this plugin. Secondly, I'll add a plugin routine in my epub validation that checks if the epub ncx has page-maps. If page-maps are found then the user will be notified by dialog message and plugin run will immediately be cancelled.

Last edited by slowsmile; 03-28-2018 at 09:55 PM.
slowsmile is offline   Reply With Quote
Old 03-28-2018, 10:13 PM   #40
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
Sounds like a compromise. But FYI - NCX page tables are epubcheck compliant and have the same issue as well as guide sections in the opf that use fragments. Both of these are epub2 compliant and can contain ids that are used in xhtml files.
KevinH is offline   Reply With Quote
Old 03-28-2018, 10:43 PM   #41
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@KevinH...I'm not sure what you mean by page tables. Are they the same as Adobe page-maps? I don't even know whether the page-map info that I have read is up to date from the links in your post above.

I also don't understand why page-maps are regarded as an industrial standard when the only major ereaders that support and use Adobe page-maps are ADE and Sony which I don't really regard as a particularly significant portion of the ereader market -- so how can page-maps be regarded as an accepted industrial standard ?

Anyway, I'll get these plugin changes done as quickly as I can.
slowsmile is offline   Reply With Quote
Old 03-29-2018, 05:04 AM   #42
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
@slowsmile: ADE pagemaps are an Adobe extension and books that contain them won't pass epubcheck. They're actually not that common.

The NCX page tables that KevinH referred to are (epub 2.0.1-compliant) page number tables wrapped in <pageList> tags. They're rarely found in epub2 books because only some DAISY-compliant apps support them. (BTW, they are supported by the epub3 output plugin.)

Since they basically use the same syntax as TOC entries they also might contain fragment ids.

If you don't want to deal with them, simply check for the presence of <pageList> tags in toc.ncx and display a warning.
Doitsu is offline   Reply With Quote
Old 03-29-2018, 06:08 AM   #43
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@Doitsu...Thanks for that useful info and for the pageList advice. To check for a page-map file in epub is fairly easy. I'm using the bk.getpagemapid() which should always return id = "map" if a page-map.xml file is present in the epub. For pageList -- as you say -- I'll probably have to look for that tag in the ncx.

Last edited by slowsmile; 03-29-2018 at 07:30 AM.
slowsmile is offline   Reply With Quote
Old 03-29-2018, 06:40 AM   #44
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: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I take no issue with you not wanting to support page-maps in your plugins. I only took issue with the notion that it was OK break them because they're not spec (Adobe), or because you didn't want to allow for them (ncx).

Warning and bailing if they're present is a perfectly reasonable and conscientious compromise. Thanks.
DiapDealer is offline   Reply With Quote
Old 03-29-2018, 07:40 AM   #45
slowsmile
Witchman
slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.slowsmile ought to be getting tired of karma fortunes by now.
 
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
@DiapDealer...I appreciate what you've said and I agree with you for the most part. As I've described above, I think I've put in enough plugin checks to ensure that the plugin will not break the epub if there is a page-map file present. I've also just put in another warning and bailout about not using pageLists in the ncx as Doitsu has suggested. Hopefully that should be enough.

Last edited by slowsmile; 03-29-2018 at 07:44 AM.
slowsmile is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing plugin in Calibre removes it from all instances of Calibre oblox Calibre 9 09-09-2016 05:39 AM
iPad Possibility to sync bookmarks through side loaded ePubs (Any iOS software?) andsoitgoes Apple Devices 12 04-13-2012 07:38 PM
Modify bookmarks in epubs silentguy Development 3 08-03-2011 05:37 PM
Sideloaded ePubs, chapters and bookmarks Steven Lyle Jordan Nook Color & Nook Tablet 10 02-05-2011 06:35 PM
Problem (bug) with bookmarks in PDF plugin (2.0 RC2) luite iRex 1 07-12-2010 02:36 AM


All times are GMT -4. The time now is 09:16 PM.


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