git.iko.soy/typeable/pandoc
on master help sign in
EPUB: removed need for separate epub-titlepage template.
83b326bJohn MacFarlane
README+1−1
@@ -661,7 +661,7 @@ by putting a file `templates/default.FORMAT` in the user data
661directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
661directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
662customize the `default.opendocument` template. For `pdf` output,
662customize the `default.opendocument` template. For `pdf` output,
663customize the `default.latex` template. For `epub` and `epub3` output,
663customize 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.
665
665
666Templates may contain *variables*. Variable names are sequences of
666Templates may contain *variables*. Variable names are sequences of
667alphanumerics, `-`, and `_`, starting with a letter. A variable name
667alphanumerics, `-`, and `_`, starting with a letter. A variable name
pandoc.cabal+1−1
@@ -49,7 +49,7 @@ Data-Files:
49 templates/default.slideous,
49 templates/default.slideous,
50 templates/default.dzslides, templates/default.asciidoc,
50 templates/default.dzslides, templates/default.asciidoc,
51 templates/default.textile, templates/default.org,
51 templates/default.textile, templates/default.org,
52− templates/epub-titlepage.html, templates/epub-page.html,
52+ templates/epub-page.html,
53 -- data for ODT writer
53 -- data for ODT writer
54 reference.odt,
54 reference.odt,
55 -- data for docx writer
55 -- data for docx writer
src/Text/Pandoc/Writers/EPUB.hs+3−8
@@ -95,9 +95,6 @@ writeEPUB version opts doc@(Pandoc meta _) = do
95 let sourceDir = writerSourceDirectory opts'
95 let sourceDir = writerSourceDirectory opts'
96 let mbCoverImage = lookup "epub-cover-image" vars
96 let mbCoverImage = lookup "epub-cover-image" vars
97
97
98− titlePageTemplate <- readDataFile (writerUserDataDir opts')
99− $ "templates" </> "epub-titlepage" <.> "html"
100−
101 -- cover page
98 -- cover page
102 (cpgEntry, cpicEntry) <-
99 (cpgEntry, cpicEntry) <-
103 case mbCoverImage of
100 case mbCoverImage of
@@ -111,11 +108,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do
111 , [mkEntry coverImage imgContent] )
108 , [mkEntry coverImage imgContent] )
112
109
113 -- title page
110 -- title page
114− let tpContent = fromStringLazy $ writeHtmlString
111+ let tpContent = renderHtml $ writeHtml opts'{
115− opts'{writerTemplate = titlePageTemplate,
116− writerHtml5 = epub3,
117− writerVariables = vars}
112+ writerVariables = ("titlepage","true"):vars }
118− (Pandoc meta [])
113+ (Pandoc meta [])
119 let tpEntry = mkEntry "title_page.xhtml" tpContent
114 let tpEntry = mkEntry "title_page.xhtml" tpContent
120
115
121 -- handle pictures
116 -- handle pictures
templates+1−1

Submodule changed.