From eb851a41ca8e7b045a483837e676d31de21efe95 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 14 Jan 2010 05:54:38 +0000 Subject: Added --data-dir option. + This specifies a user data directory. If not specified, will default to ~/.pandoc on unix or Application Data\pandoc on Windows. Files placed in the user data directory will override system default data files. + Added datadir parameter to readDataFile, saveOpenDocumentAsODT, latexMathMLScript, s5HeaderIncludes, and getTemplate. Removed getDefaultTemplate. + Updated documentation. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1809 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/ODT.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/ODT.hs') diff --git a/src/Text/Pandoc/ODT.hs b/src/Text/Pandoc/ODT.hs index 7b5fe9daa..bd497d0b3 100644 --- a/src/Text/Pandoc/ODT.hs +++ b/src/Text/Pandoc/ODT.hs @@ -42,18 +42,18 @@ import System.Directory import Control.Monad (liftM) -- | Produce an ODT file from OpenDocument XML. -saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced. +saveOpenDocumentAsODT :: FilePath -- ^ Path of user data directory + -> FilePath -- ^ Pathname of ODT file to be produced. -> FilePath -- ^ Relative directory of source file. -> Maybe FilePath -- ^ Path specified by --reference-odt -> String -- ^ OpenDocument XML contents. -> IO () -saveOpenDocumentAsODT destinationODTPath sourceDirRelative mbRefOdt xml = do +saveOpenDocumentAsODT datadir destinationODTPath sourceDirRelative mbRefOdt xml = do refArchive <- liftM toArchive $ case mbRefOdt of Just f -> B.readFile f Nothing -> do - userDataDir <- getAppUserDataDirectory "pandoc" - let userRefOdt = userDataDir "reference.odt" + let userRefOdt = datadir "reference.odt" userRefOdtExists <- doesFileExist userRefOdt if userRefOdtExists then B.readFile userRefOdt -- cgit v1.2.3