git.iko.soy/typeable/pandoc
on master help sign in
Epub Writer: Add cover reference to guide element

Fixes an issue with calibre http://calibre-ebook.com/ putting the cover at the end of the book if the spine has linear="no". Apparently this is best practice for other converters as well. http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6

commitd07dc971da0123149e751dff987cf9df1a55b75d authorShaun Attfield (shaun@victor) <heurist+git@gmail.com> dateMon 18 Nov 2013, 11:53 (13 years ago) parente690c87
1 file changed+4−2
src/Text/Pandoc/Writers/EPUB.hs+4−2
src/Text/Pandoc/Writers/EPUB.hs+4−2
@@ -260,8 +260,10 @@ writeEPUB opts doc@(Pandoc meta _) = do
260260 else "no")] $ ()) :
261261 map chapterRefNode chapterEntries)
262262 , unode "guide" $
263− unode "reference" !
264− [("type","toc"),("title",plainTitle),("href","nav.xhtml")] $ ()
263+ [ unode "reference" !
264+ [("type","toc"),("title",plainTitle),("href","nav.xhtml")] $ () ]
265+ ++ [ unode "reference" !
266+ [("type","cover"),("title","Cover"),("href","cover.xhtml")] $ () ]
265267 ]
266268 let contentsEntry = mkEntry "content.opf" contentsData
267269