04-25-2010, 07:40 AM | #1 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Multiple reference elements with the same type in the <guide>
I've been brushing up on the <guide> element part of the OPF spec since I'm adding this functionality to Sigil, and from my understanding of it, it can have several <reference> elements with the same type.
That makes no sense to me. How can a book have several Lists of Illustration, or several indices or several title pages? Sure, I could imagine an omnibus of sorts needing this, but it still seems... weird. What I find particularly puzzling is that guide part of the spec IMHO seems to be written with the assumption that there can be no such duplicates. The description of the "text" type states: Quote:
Clearly, since the spec doesn't forbid it, it is allowed. What I'm interested in is whether this is a good idea. Honestly, I don't think it is. And the least you could say about that part of the spec is that it should have a statement eliminating the ambiguity. I'm interested in what others think about this. Last edited by Valloric; 04-25-2010 at 07:46 AM. |
|
04-25-2010, 09:55 AM | #2 |
frumious Bandersnatch
Posts: 7,531
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
In general, I agree, one would only want a single element of each type. But in other cases it would be too restrictive to have such a... er... restriction. A book can have several forewords, and definitely multiple (e.g.) other.map instances, each of them would be identified with a different "title" attribute. At the end of it, it's up to the reading system to properly handle these cases, and I'm sure all of them will assume there's only a toc and a cover (I don't even know a RS that deals with multiple titles or languages ), so even if it's allowed by the spec, and it could make sense in some cases, I don't think one should expect it to work any time soon...
|
Advert | |
|
04-25-2010, 10:26 AM | #3 |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
|
04-25-2010, 10:29 AM | #4 |
creator of calibre
Posts: 44,327
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As long as the combination of (type,title) is unique, I think its OK.
|
04-25-2010, 10:38 AM | #5 |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
|
Advert | |
|
04-25-2010, 10:45 AM | #6 |
creator of calibre
Posts: 44,327
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Certainly, the spec should specify that (title, type) must be unique. From the perspective of Sigil, I would assume that the spec does specify that.
|
04-25-2010, 10:57 AM | #7 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
Code:
<define name="OPF20.reference-element">
<element name="reference">
<ref name="OPF20.optional-id-attribute"/>
<attribute name="type">
<text/>
</attribute>
<optional>
<attribute name="title">
<text/>
</attribute>
</optional>
<attribute name="href">
<text/>
</attribute>
<ref name="OPF20.reference-content"/>
</element>
</define>
|
|
04-25-2010, 11:10 AM | #8 |
creator of calibre
Posts: 44,327
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I meant that if you impose that restriction, you will be compliant with the spec and not generate EPUB's with meaningless guide entries.
|
04-25-2010, 11:18 AM | #9 | |
Created Sigil, FlightCrew
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
Quote:
But I'm going to go with the Sigil UI only supporting one instance of one guide type per book. From what I gather, this is what 99% of the users want, and it also simplifies the UI (there's no need to input a separate title attribute). Direct OPF editing will come in the future, so those 1% will be able to do that then. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding a <reference> item to <guide> in OPF file | GRiker | Sigil | 2 | 04-12-2010 01:06 PM |
Help me out: First use of these 4 sci-fi literary elements | Steven Lake | Writers' Corner | 7 | 12-31-2009 10:02 AM |
Reference Guide: How to Prepare Images for EPUB (and other) Formats | Zorba | ePub | 13 | 11-22-2009 08:28 AM |
Display File Type and Sort by Type | pragmortal | Calibre | 7 | 09-21-2009 08:07 PM |
Free PDF: Ubuntu Pocket Guide and Reference | TadW | Deals and Resources (No Self-Promotion or Affiliate Links) | 4 | 01-30-2009 11:22 PM |