diff options
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Biblio.hs | 5 | ||||
| -rw-r--r-- | src/Text/Pandoc/Shared.hs | 12 |
2 files changed, 3 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs index 12911e1ee..a60909e19 100644 --- a/src/Text/Pandoc/Biblio.hs +++ b/src/Text/Pandoc/Biblio.hs @@ -38,10 +38,11 @@ import Text.Pandoc.Definition -- | Process a 'Pandoc' document by adding citations formatted -- according to a CSL style, using 'citeproc' from citeproc-hs. -processBiblio :: Style -> [Reference] -> Pandoc -> IO Pandoc -processBiblio csl r p +processBiblio :: FilePath -> [Reference] -> Pandoc -> IO Pandoc +processBiblio cslfile r p = if null r then return p else do + csl <- readCSLFile cslfile p' <- processWithM setHash p let (nts,grps) = if styleClass csl /= "note" then (,) [] $ queryWith getCitation p' 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 |
