@@ -110,12 +110,42 @@ readPandocBiblios ropt csl biblios item = do
110
110
111
111
112
112
--------------------------------------------------------------------------------
113
+
114
+ -- | Process a bibliography file with the given style.
115
+ --
116
+ -- This function supports pandoc's
117
+ -- <https://pandoc.org/chunkedhtml-demo/9.6-including-uncited-items-in-the-bibliography.html nocite>
118
+ -- functionality when there is a @nocite@ metadata field present.
119
+ --
120
+ -- ==== __Example__
121
+ --
122
+ -- In your main function, first compile the respective files:
123
+ --
124
+ -- > main = hakyll $ do
125
+ -- > …
126
+ -- > match "style.csl" $ compile cslCompiler
127
+ -- > match "bib.bib" $ compile biblioCompiler
128
+ --
129
+ -- Then, create a function like the following:
130
+ --
131
+ -- > processBib :: Item Pandoc -> Compiler (Item Pandoc)
132
+ -- > processBib pandoc = do
133
+ -- > csl <- load @CSL "bib/style.csl"
134
+ -- > bib <- load @Biblio "bib/bibliography.bib"
135
+ -- > processPandocBiblio csl bib pandoc
136
+ --
137
+ -- Now, feed this function to your pandoc compiler:
138
+ --
139
+ -- > myCompiler :: Compiler (Item String)
140
+ -- > myCompiler = pandocItemCompilerWithTransformM myReader myWriter processBib
113
141
processPandocBiblio :: Item CSL
114
142
-> Item Biblio
115
143
-> (Item Pandoc )
116
144
-> Compiler (Item Pandoc )
117
145
processPandocBiblio csl biblio = processPandocBiblios csl [biblio]
118
146
147
+ -- | Like 'processPandocBiblio', which see, but support multiple bibliography
148
+ -- files.
119
149
processPandocBiblios :: Item CSL
120
150
-> [Item Biblio ]
121
151
-> (Item Pandoc )
0 commit comments