diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-04-16 09:53:11 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-04-16 09:54:05 -0700 |
commit | 679113ab02c1e37ef56b6cadc500394382343c3f (patch) | |
tree | c9153923b8445e5efe312f403b17a293fba2cced /src/Text/Pandoc | |
parent | 4b90ffe1bd481c9330ffdad455676df6fe2fa6d4 (diff) | |
download | pandoc-679113ab02c1e37ef56b6cadc500394382343c3f.tar.gz |
Revert API change in EPUB writer.
Instead of passing the epub cover image as a parameter, we now pass
it in the list of variables. This avoids the API change introduced
in f5cbb68534c52b292c57aaf741ab94442ddadd7a without losing the
new functionality.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 18f08fc6c..5654bb004 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -49,12 +49,11 @@ import Data.Char ( toLower ) import System.Directory ( copyFile ) -- | Produce an EPUB file from a Pandoc document. -writeEPUB :: Maybe FilePath -- ^ Path of cover image - -> Maybe String -- ^ EPUB stylesheet specified at command line +writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line -> WriterOptions -- ^ Writer options -> Pandoc -- ^ Document to convert -> IO B.ByteString -writeEPUB mbCoverImage mbStylesheet opts doc@(Pandoc meta _) = do +writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do (TOD epochtime _) <- getClockTime let mkEntry path content = toEntry path epochtime content let opts' = opts{ writerEmailObfuscation = NoObfuscation @@ -62,6 +61,7 @@ writeEPUB mbCoverImage mbStylesheet opts doc@(Pandoc meta _) = do , writerWrapText = False } let sourceDir = writerSourceDirectory opts' let vars = writerVariables opts' + let mbCoverImage = lookup "epub-cover-image" vars -- cover page (cpgEntry, cpicEntry) <- |