summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-07-08 17:51:13 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2010-07-08 17:51:13 -0700
commit8af979311aebd8c8782c86987b1c6ab4754b935f (patch)
treea5aa04dbef315c210258602aa7dc6373544bfcc6 /src/Text/Pandoc/Writers
parentbf43da01c931f1fda936d6357aa3677804d80add (diff)
Get default stylesheet in EPUB writer, rather than pandoc.hs.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs7
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