summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/ODT.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:11:49 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-12-31 01:11:49 +0000
commitb80de325b75671fe923aac8834caedbe0c795b63 (patch)
tree5bb64818d4998469fc4d10b96a67bdb8edb668ff /src/Text/Pandoc/ODT.hs
parentfad620c0042fd55de44c0624c9ac8c726b6311c2 (diff)
Moved odt-styles -> odt. Changed ODT module to look at user data first.
So if the user has an odt-styles directory in ~/.pandoc, it will be used instead of the default. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1694 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/ODT.hs')
-rw-r--r--src/Text/Pandoc/ODT.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Text/Pandoc/ODT.hs b/src/Text/Pandoc/ODT.hs
index d2e8f45f8..01390cbbf 100644
--- a/src/Text/Pandoc/ODT.hs
+++ b/src/Text/Pandoc/ODT.hs
@@ -39,6 +39,7 @@ import Text.ParserCombinators.Parsec
import System.Time
import Text.Pandoc.Shared ( inDirectory )
import Paths_pandoc ( getDataFileName )
+import System.Directory
-- | Produce an ODT file from OpenDocument XML.
saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
@@ -46,7 +47,12 @@ saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
-> String -- ^ OpenDocument XML contents.
-> IO ()
saveOpenDocumentAsODT destinationODTPath sourceDirRelative xml = do
- refArchivePath <- getDataFileName $ "data" </> "odt-styles"
+ userDir <- getAppUserDataDirectory "pandoc"
+ userOdtExists <- doesFileExist $
+ userDir </> "data" </> "odt" </> "styles.xml"
+ refArchivePath <- if userOdtExists
+ then return $ userDir </> "data" </> "odt"
+ else getDataFileName $ "data" </> "odt"
refArchive <- inDirectory refArchivePath $
addFilesToArchive [OptRecursive] emptyArchive ["."]
-- handle pictures