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

2
README
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, directory (see `--data-dir`, above). *Exceptions:* For `odt` output,
customize the `default.opendocument` template. For `pdf` output, customize the `default.opendocument` template. For `pdf` output,
customize the `default.latex` template. For `epub` and `epub3` 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 Templates may contain *variables*. Variable names are sequences of
alphanumerics, `-`, and `_`, starting with a letter. A variable name alphanumerics, `-`, and `_`, starting with a letter. A variable name

View file

@ -49,7 +49,7 @@ Data-Files:
templates/default.slideous, templates/default.slideous,
templates/default.dzslides, templates/default.asciidoc, templates/default.dzslides, templates/default.asciidoc,
templates/default.textile, templates/default.org, templates/default.textile, templates/default.org,
templates/epub-titlepage.html, templates/epub-page.html, templates/epub-page.html,
-- data for ODT writer -- data for ODT writer
reference.odt, reference.odt,
-- data for docx writer -- data for docx writer

View file

@ -95,9 +95,6 @@ writeEPUB version opts doc@(Pandoc meta _) = do
let sourceDir = writerSourceDirectory opts' let sourceDir = writerSourceDirectory opts'
let mbCoverImage = lookup "epub-cover-image" vars let mbCoverImage = lookup "epub-cover-image" vars
titlePageTemplate <- readDataFile (writerUserDataDir opts')
$ "templates" </> "epub-titlepage" <.> "html"
-- cover page -- cover page
(cpgEntry, cpicEntry) <- (cpgEntry, cpicEntry) <-
case mbCoverImage of case mbCoverImage of
@ -111,10 +108,8 @@ writeEPUB version opts doc@(Pandoc meta _) = do
, [mkEntry coverImage imgContent] ) , [mkEntry coverImage imgContent] )
-- title page -- title page
let tpContent = fromStringLazy $ writeHtmlString let tpContent = renderHtml $ writeHtml opts'{
opts'{writerTemplate = titlePageTemplate, writerVariables = ("titlepage","true"):vars }
writerHtml5 = epub3,
writerVariables = vars}
(Pandoc meta []) (Pandoc meta [])
let tpEntry = mkEntry "title_page.xhtml" tpContent let tpEntry = mkEntry "title_page.xhtml" tpContent

@ -1 +1 @@
Subproject commit cd898b1d2febb88686054e4a63690b8c7891ae03 Subproject commit 1709949ce52424737549c365cf549995df0435e0