From 679113ab02c1e37ef56b6cadc500394382343c3f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 16 Apr 2011 09:53:11 -0700 Subject: 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. --- src/Text/Pandoc/Writers/EPUB.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Writers') 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) <- -- cgit v1.2.3