on master help sign in
updated to work with pandoc 1.12

Pandoc 1.12 decouples citeproc-hs from itself, so there is no longer a Text.Pandoc.Biblio module in Pandoc. Further, citeproc-hs depends on pandoc-types 1.10 but Pandoc 1.12 depends on pandoc-types 1.12. To alleviate these issues, pandoc-citeproc was created which includes a copy of the citeproc-hs source made to be compatible, since the developer of citeproc-hs is apparently MIA. pandoc-citeproc is a separate module that handles the mixture of citeproc-hs and Pandoc. It includes `processCites` in Text.CSL.Pandoc, which is the new name of what used to be `processBiblio` from Text.Pandoc.Biblio Most of these changes are seamless, consisting of simple name changes in both functions and modules. However, a more direct change in the Hakyll API itself is that `readPandocBiblio`'s second parameter, the CSL, is now mandatory, i.e. not of type Maybe. This is to reflect the same change in the underlying processing function from Text.CSL.Pandoc, `processCites`, where the Style argument is now mandatory, and the style is derived from the CSL. See the old function: processBiblio :: Maybe Style -> [Reference] -> Pandoc -> Pandoc Compared to the new one: processCites :: Style -> [Reference] -> Pandoc -> Pandoc Sources: * http://hackage.haskell.org/packages/archive/pandoc/1.11.1/doc/html/Text-Pandoc-Biblio.html * http://hackage.haskell.org/packages/archive/pandoc-citeproc/0.1/doc/html/Text-CSL-Pandoc.html Similarly, there is no longer a `readerReferences` field in the reader options structure.

commita590a9a57f2f74547670469db946407be02e2a11 authorJorge Israel Peña <jorgepblank@gmail.com> dateMon 16 Sep 2013, 23:25 (13 years ago) parent36f9a9c
2 files changed+62−65
hakyll.cabal+56−56 src/Hakyll/Web/Pandoc/Biblio.hs+6−9
hakyll.cabal+56−56
@@ -141,33 +141,33 @@ Library
141141 Paths_hakyll
142142
143143 Build-Depends:
144− base >= 4 && < 5,
145− binary >= 0.5 && < 0.8,
146− blaze-html >= 0.5 && < 0.7,
147− blaze-markup >= 0.5.1 && < 0.6,
148− bytestring >= 0.9 && < 0.11,
149− citeproc-hs >= 0.3.2 && < 0.4,
150− cmdargs >= 0.10 && < 0.11,
151− containers >= 0.3 && < 0.6,
152− cryptohash >= 0.7 && < 0.11,
153− data-default >= 0.4 && < 0.6,
154− deepseq >= 1.3 && < 1.4,
155− directory >= 1.0 && < 1.3,
156− filepath >= 1.0 && < 1.4,
157− lrucache >= 1.1.1 && < 1.2,
158− mtl >= 1 && < 2.2,
159− network >= 2.4 && < 2.5,
160− old-locale >= 1.0 && < 1.1,
161− old-time >= 1.0 && < 1.2,
162− pandoc >= 1.10 && < 1.12,
163− parsec >= 3.0 && < 3.2,
164− process >= 1.0 && < 1.2,
165− random >= 1.0 && < 1.1,
166− regex-base >= 0.93 && < 0.94,
167− regex-tdfa >= 1.1 && < 1.2,
168− tagsoup >= 0.12.6 && < 0.13,
169− text >= 0.11 && < 1.12,
170− time >= 1.1 && < 1.5
144+ base >= 4 && < 5,
145+ binary >= 0.5 && < 0.8,
146+ blaze-html >= 0.5 && < 0.7,
147+ blaze-markup >= 0.5.1 && < 0.6,
148+ bytestring >= 0.9 && < 0.11,
149+ cmdargs >= 0.10 && < 0.11,
150+ containers >= 0.3 && < 0.6,
151+ cryptohash >= 0.7 && < 0.11,
152+ data-default >= 0.4 && < 0.6,
153+ deepseq >= 1.3 && < 1.4,
154+ directory >= 1.0 && < 1.3,
155+ filepath >= 1.0 && < 1.4,
156+ lrucache >= 1.1.1 && < 1.2,
157+ mtl >= 1 && < 2.2,
158+ network >= 2.4 && < 2.5,
159+ old-locale >= 1.0 && < 1.1,
160+ old-time >= 1.0 && < 1.2,
161+ pandoc >= 1.12 && < 1.14,
162+ pandoc-citeproc >= 0.1 && < 0.2,
163+ parsec >= 3.0 && < 3.2,
164+ process >= 1.0 && < 1.2,
165+ random >= 1.0 && < 1.1,
166+ regex-base >= 0.93 && < 0.94,
167+ regex-tdfa >= 1.1 && < 1.2,
168+ tagsoup >= 0.12.6 && < 0.13,
169+ text >= 0.11 && < 1.12,
170+ time >= 1.1 && < 1.5
171171
172172 If flag(previewServer)
173173 Build-depends:
@@ -224,36 +224,36 @@ Test-suite hakyll-tests
224224 HUnit >= 1.2 && < 1.3,
225225 QuickCheck >= 2.4 && < 2.7,
226226 test-framework >= 0.4 && < 0.9,
227− test-framework-hunit >= 0.2 && < 0.4,
228− test-framework-quickcheck2 >= 0.2 && < 0.4,
227+ test-framework-hunit >= 0.3 && < 0.4,
228+ test-framework-quickcheck2 >= 0.3 && < 0.4,
229229 -- Copy pasted from hakyll dependencies:
230− base >= 4 && < 5,
231− binary >= 0.5 && < 0.8,
232− blaze-html >= 0.5 && < 0.7,
233− blaze-markup >= 0.5.1 && < 0.6,
234− bytestring >= 0.9 && < 0.11,
235− citeproc-hs >= 0.3.2 && < 0.4,
236− cmdargs >= 0.10 && < 0.11,
237− containers >= 0.3 && < 0.6,
238− cryptohash >= 0.7 && < 0.11,
239− data-default >= 0.4 && < 0.6,
240− deepseq >= 1.3 && < 1.4,
241− directory >= 1.0 && < 1.3,
242− filepath >= 1.0 && < 1.4,
243− lrucache >= 1.1.1 && < 1.2,
244− mtl >= 1 && < 2.2,
245− network >= 2.4 && < 2.5,
246− old-locale >= 1.0 && < 1.1,
247− old-time >= 1.0 && < 1.2,
248− pandoc >= 1.10 && < 1.12,
249− parsec >= 3.0 && < 3.2,
250− process >= 1.0 && < 1.2,
251− random >= 1.0 && < 1.1,
252− regex-base >= 0.93 && < 0.94,
253− regex-tdfa >= 1.1 && < 1.2,
254− tagsoup >= 0.12.6 && < 0.13,
255− text >= 0.11 && < 1.12,
256− time >= 1.1 && < 1.5
230+ base >= 4 && < 5,
231+ binary >= 0.5 && < 0.8,
232+ blaze-html >= 0.5 && < 0.7,
233+ blaze-markup >= 0.5.1 && < 0.6,
234+ bytestring >= 0.9 && < 0.11,
235+ cmdargs >= 0.10 && < 0.11,
236+ containers >= 0.3 && < 0.6,
237+ cryptohash >= 0.7 && < 0.11,
238+ data-default >= 0.4 && < 0.6,
239+ deepseq >= 1.3 && < 1.4,
240+ directory >= 1.0 && < 1.3,
241+ filepath >= 1.0 && < 1.4,
242+ lrucache >= 1.1.1 && < 1.2,
243+ mtl >= 1 && < 2.2,
244+ network >= 2.4 && < 2.5,
245+ old-locale >= 1.0 && < 1.1,
246+ old-time >= 1.0 && < 1.2,
247+ pandoc >= 1.12 && < 1.14,
248+ pandoc-citeproc >= 0.1 && < 0.2,
249+ parsec >= 3.0 && < 3.2,
250+ process >= 1.0 && < 1.2,
251+ random >= 1.0 && < 1.1,
252+ regex-base >= 0.93 && < 0.94,
253+ regex-tdfa >= 1.1 && < 1.2,
254+ tagsoup >= 0.12.6 && < 0.13,
255+ text >= 0.11 && < 1.12,
256+ time >= 1.1 && < 1.5
257257
258258 If flag(previewServer)
259259 Build-depends:
src/Hakyll/Web/Pandoc/Biblio.hs+6−9
@@ -22,12 +22,10 @@ module Hakyll.Web.Pandoc.Biblio
2222--------------------------------------------------------------------------------
2323import Control.Applicative ((<$>))
2424import Data.Binary (Binary (..))
25−import Data.Traversable (traverse)
2625import Data.Typeable (Typeable)
2726import qualified Text.CSL as CSL
27+import Text.CSL.Pandoc (processCites)
2828import Text.Pandoc (Pandoc, ReaderOptions (..))
29−import Text.Pandoc.Biblio (processBiblio)
30−
3129
3230--------------------------------------------------------------------------------
3331import Hakyll.Core.Compiler
@@ -86,21 +84,20 @@ biblioCompiler = do
8684
8785--------------------------------------------------------------------------------
8886readPandocBiblio :: ReaderOptions
89− -> Maybe (Item CSL)
87+ -> Item CSL
9088 -> Item Biblio
9189 -> (Item String)
9290 -> Compiler (Item Pandoc)
9391readPandocBiblio ropt csl biblio item = do
9492 -- Parse CSL file, if given
95− style <- unsafeCompiler $
96− traverse (CSL.readCSLFile . toFilePath . itemIdentifier) csl
93+ style <- unsafeCompiler $ CSL.readCSLFile . toFilePath . itemIdentifier $ csl
9794
9895 -- We need to know the citation keys, add then *before* actually parsing the
9996 -- actual page. If we don't do this, pandoc won't even consider them
10097 -- citations!
10198 let Biblio refs = itemBody biblio
102− ropt' = ropt {readerReferences = readerReferences ropt ++ refs}
103− pandoc = itemBody $ readPandocWith ropt' item
104− pandoc' = processBiblio style refs pandoc
99+ pandoc = itemBody $ readPandocWith ropt item
100+ pandoc' = processCites style refs pandoc
105101
106102 return $ fmap (const pandoc') item
103+