From bbb60a2586f29785fd9ba592770bc2f7842deba4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 18 Nov 2010 14:15:26 -0800 Subject: If --csl not specified, read from data files or default. Thus --csl behaves like --reference-odt, --template, etc. --- src/Text/Pandoc/Biblio.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc/Biblio.hs') diff --git a/src/Text/Pandoc/Biblio.hs b/src/Text/Pandoc/Biblio.hs index dde822da8..12911e1ee 100644 --- a/src/Text/Pandoc/Biblio.hs +++ b/src/Text/Pandoc/Biblio.hs @@ -29,7 +29,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA module Text.Pandoc.Biblio ( processBiblio ) where -import Control.Monad ( when ) import Data.List import Data.Unique import qualified Data.Map as M @@ -39,12 +38,10 @@ import Text.Pandoc.Definition -- | Process a 'Pandoc' document by adding citations formatted -- according to a CSL style, using 'citeproc' from citeproc-hs. -processBiblio :: String -> [Reference] -> Pandoc -> IO Pandoc -processBiblio cf r p +processBiblio :: Style -> [Reference] -> Pandoc -> IO Pandoc +processBiblio csl r p = if null r then return p else do - when (null cf) $ error "Missing the needed citation style file" - csl <- readCSLFile cf p' <- processWithM setHash p let (nts,grps) = if styleClass csl /= "note" then (,) [] $ queryWith getCitation p' -- cgit v1.2.3