EPUB: removed need for separate epub-titlepage template.

The titlepage stuff is now folded into the epub-page template.
A titlepage variable selects it.
This commit is contained in:
John MacFarlane
2012-11-04 21:08:40 -08:00
parent a7b8351d43
commit 83b326b005
4 changed files with 6 additions and 11 deletions
+1 -1
View File
@@ -661,7 +661,7 @@ by putting a file `templates/default.FORMAT` in the user data
directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
customize the `default.opendocument` template. For `pdf` output,
customize the `default.latex` template. For `epub` and `epub3` output,
customize the `epub-page.html`, and `epub-titlepage.html` templates.
customize the `epub-page.html` template.
Templates may contain *variables*. Variable names are sequences of
alphanumerics, `-`, and `_`, starting with a letter. A variable name
+1 -1
View File
@@ -49,7 +49,7 @@ Data-Files:
templates/default.slideous,
templates/default.dzslides, templates/default.asciidoc,
templates/default.textile, templates/default.org,
templates/epub-titlepage.html, templates/epub-page.html,
templates/epub-page.html,
-- data for ODT writer
reference.odt,
-- data for docx writer
+3 -8
View File
@@ -95,9 +95,6 @@ writeEPUB version opts doc@(Pandoc meta _) = do
let sourceDir = writerSourceDirectory opts'
let mbCoverImage = lookup "epub-cover-image" vars
titlePageTemplate <- readDataFile (writerUserDataDir opts')
$ "templates" </> "epub-titlepage" <.> "html"
-- cover page
(cpgEntry, cpicEntry) <-
case mbCoverImage of
@@ -111,11 +108,9 @@ writeEPUB version opts doc@(Pandoc meta _) = do
, [mkEntry coverImage imgContent] )
-- title page
let tpContent = fromStringLazy $ writeHtmlString
opts'{writerTemplate = titlePageTemplate,
writerHtml5 = epub3,
writerVariables = vars}
(Pandoc meta [])
let tpContent = renderHtml $ writeHtml opts'{
writerVariables = ("titlepage","true"):vars }
(Pandoc meta [])
let tpEntry = mkEntry "title_page.xhtml" tpContent
-- handle pictures