git.iko.soy/typeable/pandoc
on master help sign in
EPUB: removed need for separate epub-titlepage template.

The titlepage stuff is now folded into the epub-page template. A titlepage variable selects it.

commit83b326b005c3917cee9a475bbac00462cd5ffe5a authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 4 Nov 2012, 21:08 (14 years ago) parenta7b8351
4 files changed+6−11
README+1−1 pandoc.cabal+1−1 src/Text/Pandoc/Writers/EPUB.hs+3−8 templates+1−1
README+1−1
@@ -661,7 +661,7 @@ by putting a file `templates/default.FORMAT` in the user data
661661directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
662662customize the `default.opendocument` template. For `pdf` output,
663663customize the `default.latex` template. For `epub` and `epub3` output,
664−customize the `epub-page.html`, and `epub-titlepage.html` templates.
664+customize the `epub-page.html` template.
665665
666666Templates may contain *variables*. Variable names are sequences of
667667alphanumerics, `-`, and `_`, starting with a letter. A variable name
pandoc.cabal+1−1
@@ -49,7 +49,7 @@ Data-Files:
4949 templates/default.slideous,
5050 templates/default.dzslides, templates/default.asciidoc,
5151 templates/default.textile, templates/default.org,
52− templates/epub-titlepage.html, templates/epub-page.html,
52+ templates/epub-page.html,
5353 -- data for ODT writer
5454 reference.odt,
5555 -- data for docx writer
src/Text/Pandoc/Writers/EPUB.hs+3−8
@@ -95,9 +95,6 @@ writeEPUB version opts doc@(Pandoc meta _) = do
9595 let sourceDir = writerSourceDirectory opts'
9696 let mbCoverImage = lookup "epub-cover-image" vars
9797
98− titlePageTemplate <- readDataFile (writerUserDataDir opts')
99− $ "templates" </> "epub-titlepage" <.> "html"
100−
10198 -- cover page
10299 (cpgEntry, cpicEntry) <-
103100 case mbCoverImage of
@@ -111,11 +108,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do
111108 , [mkEntry coverImage imgContent] )
112109
113110 -- title page
114− let tpContent = fromStringLazy $ writeHtmlString
115− opts'{writerTemplate = titlePageTemplate,
116− writerHtml5 = epub3,
117− writerVariables = vars}
118− (Pandoc meta [])
111+ let tpContent = renderHtml $ writeHtml opts'{
112+ writerVariables = ("titlepage","true"):vars }
113+ (Pandoc meta [])
119114 let tpEntry = mkEntry "title_page.xhtml" tpContent
120115
121116 -- handle pictures
templates+1−1

Submodule changed.