diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-07-08 17:51:13 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-07-08 17:51:13 -0700 |
commit | 8af979311aebd8c8782c86987b1c6ab4754b935f (patch) | |
tree | a5aa04dbef315c210258602aa7dc6373544bfcc6 /src/Text/Pandoc | |
parent | bf43da01c931f1fda936d6357aa3677804d80add (diff) | |
download | pandoc-8af979311aebd8c8782c86987b1c6ab4754b935f.tar.gz |
Get default stylesheet in EPUB writer, rather than pandoc.hs.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/EPUB.hs | 7 |
1 files changed, 5 insertions, 2 deletions
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 |