git.iko.soy/typeable/pandoc
on master help sign in
EPUB writer: include title page in landmarks.

Closes #6919. Note that the toc is also included if `--toc` is specified.

commit7199d68ba078148ff76a38f2c483da73edd62747 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 3 Dec 2020, 21:39 (6 years ago) parent9c6cc79
2 files changed+9−3
src/Text/Pandoc/Writers/EPUB.hs+7−2 test/command/5986.md+2−1
src/Text/Pandoc/Writers/EPUB.hs+7−2
@@ -825,7 +825,12 @@ pandocToEPUB version opts doc = do
825825 [ unode "h1" ! [("id","toc-title")] $ tocTitle
826826 , unode "ol" ! [("class","toc")] $ tocBlocks ]]
827827 let landmarkItems = if epub3
828− then [ unode "li"
828+ then unode "li"
829+ [ unode "a" ! [("href",
830+ "text/title_page.xhtml")
831+ ,("epub:type", "titlepage")] $
832+ ("Title Page" :: String) ] :
833+ [ unode "li"
829834 [ unode "a" ! [("href", "text/cover.xhtml")
830835 ,("epub:type", "cover")] $
831836 ("Cover" :: String)] |
@@ -834,7 +839,7 @@ pandocToEPUB version opts doc = do
834839 [ unode "li"
835840 [ unode "a" ! [("href", "#toc")
836841 ,("epub:type", "toc")] $
837− ("Table of contents" :: String)
842+ ("Table of Contents" :: String)
838843 ] | writerTableOfContents opts
839844 ]
840845 else []
test/command/5986.md+2−1
@@ -6,7 +6,8 @@
66<p><span id="nav.xhtml"></span></p>
77<nav type="landmarks" id="landmarks" hidden="hidden">
88<ol>
9−<li><a href="#nav.xhtml#toc">Table of contents</a></li>
9+<li><a href="text/title_page.xhtml">Title Page</a></li>
10+<li><a href="#nav.xhtml#toc">Table of Contents</a></li>
1011</ol>
1112</nav>
1213<p><span id="ch001.xhtml"></span></p>