diff options
-rw-r--r-- | hakyll.cabal | 112 | ||||
-rw-r--r-- | src/Hakyll/Web/Pandoc/Biblio.hs | 15 |
2 files changed, 62 insertions, 65 deletions
diff --git a/hakyll.cabal b/hakyll.cabal index 9cc627a..7ecdacd 100644 --- a/hakyll.cabal +++ b/hakyll.cabal @@ -141,33 +141,33 @@ Library Paths_hakyll Build-Depends: - base >= 4 && < 5, - binary >= 0.5 && < 0.8, - blaze-html >= 0.5 && < 0.7, - blaze-markup >= 0.5.1 && < 0.6, - bytestring >= 0.9 && < 0.11, - citeproc-hs >= 0.3.2 && < 0.4, - cmdargs >= 0.10 && < 0.11, - containers >= 0.3 && < 0.6, - cryptohash >= 0.7 && < 0.11, - data-default >= 0.4 && < 0.6, - deepseq >= 1.3 && < 1.4, - directory >= 1.0 && < 1.3, - filepath >= 1.0 && < 1.4, - lrucache >= 1.1.1 && < 1.2, - mtl >= 1 && < 2.2, - network >= 2.4 && < 2.5, - old-locale >= 1.0 && < 1.1, - old-time >= 1.0 && < 1.2, - pandoc >= 1.10 && < 1.12, - parsec >= 3.0 && < 3.2, - process >= 1.0 && < 1.2, - random >= 1.0 && < 1.1, - regex-base >= 0.93 && < 0.94, - regex-tdfa >= 1.1 && < 1.2, - tagsoup >= 0.12.6 && < 0.13, - text >= 0.11 && < 1.12, - time >= 1.1 && < 1.5 + base >= 4 && < 5, + binary >= 0.5 && < 0.8, + blaze-html >= 0.5 && < 0.7, + blaze-markup >= 0.5.1 && < 0.6, + bytestring >= 0.9 && < 0.11, + cmdargs >= 0.10 && < 0.11, + containers >= 0.3 && < 0.6, + cryptohash >= 0.7 && < 0.11, + data-default >= 0.4 && < 0.6, + deepseq >= 1.3 && < 1.4, + directory >= 1.0 && < 1.3, + filepath >= 1.0 && < 1.4, + lrucache >= 1.1.1 && < 1.2, + mtl >= 1 && < 2.2, + network >= 2.4 && < 2.5, + old-locale >= 1.0 && < 1.1, + old-time >= 1.0 && < 1.2, + pandoc >= 1.12 && < 1.14, + pandoc-citeproc >= 0.1 && < 0.2, + parsec >= 3.0 && < 3.2, + process >= 1.0 && < 1.2, + random >= 1.0 && < 1.1, + regex-base >= 0.93 && < 0.94, + regex-tdfa >= 1.1 && < 1.2, + tagsoup >= 0.12.6 && < 0.13, + text >= 0.11 && < 1.12, + time >= 1.1 && < 1.5 If flag(previewServer) Build-depends: @@ -224,36 +224,36 @@ Test-suite hakyll-tests HUnit >= 1.2 && < 1.3, QuickCheck >= 2.4 && < 2.7, test-framework >= 0.4 && < 0.9, - test-framework-hunit >= 0.2 && < 0.4, - test-framework-quickcheck2 >= 0.2 && < 0.4, + test-framework-hunit >= 0.3 && < 0.4, + test-framework-quickcheck2 >= 0.3 && < 0.4, -- Copy pasted from hakyll dependencies: - base >= 4 && < 5, - binary >= 0.5 && < 0.8, - blaze-html >= 0.5 && < 0.7, - blaze-markup >= 0.5.1 && < 0.6, - bytestring >= 0.9 && < 0.11, - citeproc-hs >= 0.3.2 && < 0.4, - cmdargs >= 0.10 && < 0.11, - containers >= 0.3 && < 0.6, - cryptohash >= 0.7 && < 0.11, - data-default >= 0.4 && < 0.6, - deepseq >= 1.3 && < 1.4, - directory >= 1.0 && < 1.3, - filepath >= 1.0 && < 1.4, - lrucache >= 1.1.1 && < 1.2, - mtl >= 1 && < 2.2, - network >= 2.4 && < 2.5, - old-locale >= 1.0 && < 1.1, - old-time >= 1.0 && < 1.2, - pandoc >= 1.10 && < 1.12, - parsec >= 3.0 && < 3.2, - process >= 1.0 && < 1.2, - random >= 1.0 && < 1.1, - regex-base >= 0.93 && < 0.94, - regex-tdfa >= 1.1 && < 1.2, - tagsoup >= 0.12.6 && < 0.13, - text >= 0.11 && < 1.12, - time >= 1.1 && < 1.5 + base >= 4 && < 5, + binary >= 0.5 && < 0.8, + blaze-html >= 0.5 && < 0.7, + blaze-markup >= 0.5.1 && < 0.6, + bytestring >= 0.9 && < 0.11, + cmdargs >= 0.10 && < 0.11, + containers >= 0.3 && < 0.6, + cryptohash >= 0.7 && < 0.11, + data-default >= 0.4 && < 0.6, + deepseq >= 1.3 && < 1.4, + directory >= 1.0 && < 1.3, + filepath >= 1.0 && < 1.4, + lrucache >= 1.1.1 && < 1.2, + mtl >= 1 && < 2.2, + network >= 2.4 && < 2.5, + old-locale >= 1.0 && < 1.1, + old-time >= 1.0 && < 1.2, + pandoc >= 1.12 && < 1.14, + pandoc-citeproc >= 0.1 && < 0.2, + parsec >= 3.0 && < 3.2, + process >= 1.0 && < 1.2, + random >= 1.0 && < 1.1, + regex-base >= 0.93 && < 0.94, + regex-tdfa >= 1.1 && < 1.2, + tagsoup >= 0.12.6 && < 0.13, + text >= 0.11 && < 1.12, + time >= 1.1 && < 1.5 If flag(previewServer) Build-depends: diff --git a/src/Hakyll/Web/Pandoc/Biblio.hs b/src/Hakyll/Web/Pandoc/Biblio.hs index 9c4b0bf..db022bc 100644 --- a/src/Hakyll/Web/Pandoc/Biblio.hs +++ b/src/Hakyll/Web/Pandoc/Biblio.hs @@ -22,12 +22,10 @@ module Hakyll.Web.Pandoc.Biblio -------------------------------------------------------------------------------- import Control.Applicative ((<$>)) import Data.Binary (Binary (..)) -import Data.Traversable (traverse) import Data.Typeable (Typeable) import qualified Text.CSL as CSL +import Text.CSL.Pandoc (processCites) import Text.Pandoc (Pandoc, ReaderOptions (..)) -import Text.Pandoc.Biblio (processBiblio) - -------------------------------------------------------------------------------- import Hakyll.Core.Compiler @@ -86,21 +84,20 @@ biblioCompiler = do -------------------------------------------------------------------------------- readPandocBiblio :: ReaderOptions - -> Maybe (Item CSL) + -> Item CSL -> Item Biblio -> (Item String) -> Compiler (Item Pandoc) readPandocBiblio ropt csl biblio item = do -- Parse CSL file, if given - style <- unsafeCompiler $ - traverse (CSL.readCSLFile . toFilePath . itemIdentifier) csl + style <- unsafeCompiler $ CSL.readCSLFile . toFilePath . itemIdentifier $ csl -- We need to know the citation keys, add then *before* actually parsing the -- actual page. If we don't do this, pandoc won't even consider them -- citations! let Biblio refs = itemBody biblio - ropt' = ropt {readerReferences = readerReferences ropt ++ refs} - pandoc = itemBody $ readPandocWith ropt' item - pandoc' = processBiblio style refs pandoc + pandoc = itemBody $ readPandocWith ropt item + pandoc' = processCites style refs pandoc return $ fmap (const pandoc') item + |