aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-12-11 16:21:08 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:41 +0100
commit08110c371484cb74206a150fe9c2e06eeb32e475 (patch)
tree0736f75e3b16f3fd94d4859415bd0543acd9ea03 /src/Text/Pandoc/Writers
parent143d1a21139cc7b32777e4154daf6c732037b625 (diff)
downloadpandoc-08110c371484cb74206a150fe9c2e06eeb32e475.tar.gz
Class: Removed getDefaultReferenceDocx/ODT from PandocMonad.
We don't need these, since the default docx and odt can be retrieved using `readDataFile datadir "reference.docx"` (or odt).
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs5
-rw-r--r--src/Text/Pandoc/Writers/ODT.hs3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 662b4d3bb..07aed0c9b 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -224,10 +224,11 @@ writeDocx opts doc@(Pandoc meta _) = do
let doc' = walk fixDisplayMath $ doc
username <- P.lookupEnv "USERNAME"
utctime <- P.getCurrentTime
- distArchive <- P.getDefaultReferenceDocx datadir
+ distArchive <- (toArchive . BL.fromStrict) <$>
+ P.readDataFile datadir "reference.docx"
refArchive <- case writerReferenceDoc opts of
Just f -> toArchive <$> P.readFileLazy f
- Nothing -> P.getDefaultReferenceDocx datadir
+ Nothing -> return distArchive
parsedDoc <- parseXml refArchive distArchive "word/document.xml"
let wname f qn = qPrefix qn == Just "w" && f (qName qn)
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs
index a1a1c4f62..0e4999712 100644
--- a/src/Text/Pandoc/Writers/ODT.hs
+++ b/src/Text/Pandoc/Writers/ODT.hs
@@ -79,7 +79,8 @@ pandocToODT opts doc@(Pandoc meta _) = do
refArchive <-
case writerReferenceDoc opts of
Just f -> liftM toArchive $ lift $ P.readFileLazy f
- Nothing -> lift $ P.getDefaultReferenceODT datadir
+ Nothing -> lift $ (toArchive . B.fromStrict) <$>
+ P.readDataFile datadir "reference.odt"
-- handle formulas and pictures
-- picEntriesRef <- P.newIORef ([] :: [Entry])
doc' <- walkM (transformPicMath opts) $ walk fixDisplayMath doc