From b80de325b75671fe923aac8834caedbe0c795b63 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 31 Dec 2009 01:11:49 +0000 Subject: 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 --- src/Text/Pandoc/ODT.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/ODT.hs') 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 -- cgit v1.2.3