From 8af979311aebd8c8782c86987b1c6ab4754b935f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 8 Jul 2010 17:51:13 -0700 Subject: Get default stylesheet in EPUB writer, rather than pandoc.hs. --- src/Text/Pandoc/Writers/EPUB.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index 998a5aa3a..1ac2c8244 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -47,11 +47,14 @@ import Text.Pandoc.Writers.Markdown ( writePlain ) import Data.Char ( toLower ) -- | Produce an EPUB file from a Pandoc document. -writeEPUB :: String -- ^ EPUB stylesheet +writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line -> WriterOptions -- ^ Writer options -> Pandoc -- ^ Document to convert -> IO B.ByteString -writeEPUB stylesheet opts doc = do +writeEPUB mbStylesheet opts doc = do + stylesheet <- case mbStylesheet of + Just s -> return s + Nothing -> readDataFile (writerUserDataDir opts) "epub.css" (TOD epochtime _) <- getClockTime let opts' = opts{ writerEmailObfuscation = NoObfuscation , writerStandalone = True -- cgit v1.2.3