summaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-10-06 09:40:08 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-10-06 09:51:23 -0700
commitb617cce95ba2da682a5c25bf3420a5dcceb0a0b8 (patch)
treef18a627e08f37945fd756e8af3284611029e15b8 /src/pandoc.hs
parent1b68dc340554c6e45e922fb8a59ac37c7cdb5752 (diff)
Biblio: Changed type of processBiblio.
* It is no longer in the IO monad. * setHash uses state rather than Data.Unique. * It takes a Style argument rather than parameters for CSL and abbrev filenames. * pandoc.hs now calls the functions to parse the style file and add abbrevs.
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index e85cfdba1..406469598 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -1007,7 +1007,8 @@ main = do
doc2 <- do
if citeMethod == Citeproc && not (null refs)
then do
- csl <- case mbCsl of
+ csl <- CSL.parseCSL =<<
+ case mbCsl of
Nothing -> readDataFile datadir "default.csl"
Just cslfile -> do
exists <- doesFileExist cslfile
@@ -1018,7 +1019,9 @@ main = do
print csldir
readDataFile datadir (replaceDirectory
(replaceExtension cslfile "csl") csldir)
- processBiblio csl cslabbrevs refs doc1
+ abbrevs <- maybe (return []) CSL.readJsonAbbrevFile cslabbrevs
+ let csl' = csl { CSL.styleAbbrevs = abbrevs }
+ return $ processBiblio csl' refs doc1
else return doc1
let writeBinary :: B.ByteString -> IO ()