aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-11-20 08:11:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-11-20 08:11:30 -0800
commit3eef887dfa4e47095c4be9b2bdbf67c002e29f90 (patch)
treefad4a1a9c0100201f4556bb349ebaced4b986639 /src/Text/Pandoc/Shared.hs
parent46121aa2e1ad9afd8b06684fa9a36a00a73c106d (diff)
downloadpandoc-3eef887dfa4e47095c4be9b2bdbf67c002e29f90.tar.gz
Citation related changes.
* Don't look for bibliography in ~/.pandoc. Reason: doing this requires a read + parse of the bibliography even when the document doesn't use citations. This is a big performance drag on regular pandoc invocations. * Only look for default.csl if the document contains references. Reason: avoids the need to read and parse csl file when the document contains no references anyway. * Removed findFirstFile from Shared.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 67c5153c7..6cc48b88c 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -71,7 +71,6 @@ module Text.Pandoc.Shared (
defaultWriterOptions,
-- * File handling
inDirectory,
- findFirstFile,
findDataFile,
readDataFile
) where
@@ -540,17 +539,6 @@ inDirectory path action = do
setCurrentDirectory oldDir
return result
--- | Get full file path for the first of a list of files found in the
--- specified directory.
-findFirstFile :: (Maybe FilePath) -> [FilePath] -> IO (Maybe FilePath)
-findFirstFile Nothing _ = return Nothing
-findFirstFile (Just _) [] = return Nothing
-findFirstFile (Just dir) (f:fs) = do
- ex <- doesFileExist (dir </> f)
- if ex
- then return $ Just (dir </> f)
- else findFirstFile (Just dir) fs
-
-- | Get file path for data file, either from specified user data directory,
-- or, if not found there, from Cabal data directory.
findDataFile :: Maybe FilePath -> FilePath -> IO FilePath