diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-31 01:11:49 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-31 01:11:49 +0000 |
commit | b80de325b75671fe923aac8834caedbe0c795b63 (patch) | |
tree | 5bb64818d4998469fc4d10b96a67bdb8edb668ff /src | |
parent | fad620c0042fd55de44c0624c9ac8c726b6311c2 (diff) | |
download | pandoc-b80de325b75671fe923aac8834caedbe0c795b63.tar.gz |
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')
-rw-r--r-- | src/Text/Pandoc/ODT.hs | 8 |
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 |