[epub] fix for calibre warning - cover does not need linear=no attribute
authorRobert Błaut <listy@blaut.biz>
Thu, 27 Feb 2014 11:43:20 +0000 (12:43 +0100)
committerRobert Błaut <listy@blaut.biz>
Thu, 27 Feb 2014 11:43:20 +0000 (12:43 +0100)
Calibre said „There are items marked as non-linear in the <spine>.
These will be displayed in random order by different ebook readers.
Some will ignore the non-linear attribute, some will display them at
the end or the beginning of the book and some will fail to display them
at all. Instead of using non-linear items simply place the items in the
order you want them to be displayed.”

librarian/epub.py

index 81dcb6e..6377526 100644 (file)
@@ -499,7 +499,7 @@ def transform(wldoc, verbose=False,
             '<item id="cover" href="cover.html" media-type="application/xhtml+xml" />'))
         manifest.append(etree.fromstring(
             '<item id="cover-image" href="%s" media-type="%s" />' % (cover_name, bound_cover.mime_type())))
             '<item id="cover" href="cover.html" media-type="application/xhtml+xml" />'))
         manifest.append(etree.fromstring(
             '<item id="cover-image" href="%s" media-type="%s" />' % (cover_name, bound_cover.mime_type())))
-        spine.insert(0, etree.fromstring('<itemref idref="cover" linear="no" />'))
+        spine.insert(0, etree.fromstring('<itemref idref="cover"/>'))
         opf.getroot()[0].append(etree.fromstring('<meta name="cover" content="cover-image"/>'))
         guide.append(etree.fromstring('<reference href="cover.html" type="cover" title="Okładka"/>'))
 
         opf.getroot()[0].append(etree.fromstring('<meta name="cover" content="cover-image"/>'))
         guide.append(etree.fromstring('<reference href="cover.html" type="cover" title="Okładka"/>'))