summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-14 05:54:38 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-01-14 05:54:38 +0000
commiteb851a41ca8e7b045a483837e676d31de21efe95 (patch)
treec8df76905cff5a9ffecbcdec85321e5851685006 /src/Text/Pandoc/Shared.hs
parent385dcb116c4f192416228f637a45e9a1392cd172 (diff)
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
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 2f40c904f..5657321d8 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -1044,9 +1044,9 @@ inDirectory path action = do
setCurrentDirectory oldDir
return result
--- | Read file from user data directory or, if not found there, from
--- Cabal data directory. On unix the user data directory is @$HOME/.pandoc@.
-readDataFile :: FilePath -> IO String
-readDataFile fname = do
- userDir <- getAppUserDataDirectory "pandoc"
- catch (readFile $ userDir </> fname) (\_ -> getDataFileName fname >>= readFile)
+-- | Read file from specified user data directory or, if not found there, from
+-- Cabal data directory.
+readDataFile :: FilePath -> FilePath -> IO String
+readDataFile userDir fname = catch
+ (readFile $ userDir </> fname)
+ (\_ -> getDataFileName fname >>= readFile)