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

Avoiding an unnecessary list concatenation. 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

commit5b27480e54f4ecfc145bde133f1f51865d9b12a0 authorShaun Attfield (shaun@victor) <heurist+git@gmail.com> dateTue 19 Nov 2013, 08:20 (13 years ago) parentd07dc97
1 file changed+5−4
src/Text/Pandoc/Writers/EPUB.hs+5−4
src/Text/Pandoc/Writers/EPUB.hs+5−4
@@ -260,10 +260,11 @@ 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")] $ () ]
265− ++ [ unode "reference" !
266− [("type","cover"),("title","Cover"),("href","cover.xhtml")] $ () ]
263+ [ unode "reference" !
264+ [("type","toc"),("title",plainTitle),("href","nav.xhtml")] $ ()
265+ , unode "reference" !
266+ [("type","cover"),("title","Cover"),("href","cover.xhtml")] $ ()
267+ ]
267268 ]
268269 let contentsEntry = mkEntry "content.opf" contentsData
269270