mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-27 01:45:56 +00:00
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:
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
Submodule templates updated: cd898b1d2f...1709949ce5
Reference in New Issue
Block a user