diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-11-04 18:14:27 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-11-04 18:14:27 -0800 |
commit | 1f29592b64245527a493feccd99d5c0f28b572cf (patch) | |
tree | a2d0578ff178f369e1f13e9b4057155f29f45449 /src/Text | |
parent | ae6028d442df4ddc4ceb1cd7b01d7e0178d1d8e5 (diff) | |
download | pandoc-1f29592b64245527a493feccd99d5c0f28b572cf.tar.gz |
EPUB writer: Set epub3 variable before calling templates.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 6631ef349..463e2c587 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -75,18 +75,19 @@ writeEPUB version opts doc@(Pandoc meta _) = do let epub3 = version == EPUB3 epochtime <- floor `fmap` getPOSIXTime let mkEntry path content = toEntry path epochtime content + let vars = ("epub3", if epub3 then "true" else "false"):writerVariables opts let opts' = opts{ writerEmailObfuscation = NoObfuscation , writerStandalone = True , writerSectionDivs = True , writerHtml5 = epub3 , writerTableOfContents = False -- we always have one in epub + , writerVariables = vars , writerHTMLMathMethod = if epub3 then MathML Nothing else writerHTMLMathMethod opts , writerWrapText = False } let sourceDir = writerSourceDirectory opts' - let vars = ("epub3", if epub3 then "true" else "false"):writerVariables opts' let mbCoverImage = lookup "epub-cover-image" vars titlePageTemplate <- readDataFile (writerUserDataDir opts') |