Brought citeproc support up to date for citeproc-hs-0.2.

(Patch by Andrea Rossato.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@1518 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2008-12-29 22:45:18 +00:00
parent df4d5b96c7
commit 243008242d
2 changed files with 15 additions and 7 deletions

20
Main.hs
View file

@ -154,7 +154,8 @@ data Opt = Opt
, optWrapText :: Bool -- ^ Wrap text
, optSanitizeHTML :: Bool -- ^ Sanitize HTML
#ifdef _CITEPROC
, optModsFile :: String
, optBiblioFile :: String
, optBiblioFormat :: String
, optCslFile :: String
#endif
}
@ -187,7 +188,8 @@ defaultOpts = Opt
, optWrapText = True
, optSanitizeHTML = False
#ifdef _CITEPROC
, optModsFile = []
, optBiblioFile = []
, optBiblioFormat = []
, optCslFile = []
#endif
}
@ -364,11 +366,16 @@ options =
"FORMAT")
"" -- "Print default header for FORMAT"
#ifdef _CITEPROC
, Option "" ["mods"]
, Option "" ["biblio"]
(ReqArg
(\arg opt -> return opt { optModsFile = arg} )
(\arg opt -> return opt { optBiblioFile = arg} )
"FILENAME")
""
, Option "" ["biblio-format"]
(ReqArg
(\arg opt -> return opt { optBiblioFormat = arg} )
"STRING")
""
, Option "" ["csl"]
(ReqArg
(\arg opt -> return opt { optCslFile = arg} )
@ -513,7 +520,8 @@ main = do
, optWrapText = wrap
, optSanitizeHTML = sanitize
#ifdef _CITEPROC
, optModsFile = modsFile
, optBiblioFile = biblioFile
, optBiblioFormat = biblioFormat
, optCslFile = cslFile
#endif
} = opts
@ -566,7 +574,7 @@ main = do
let standalone' = (standalone && not strict) || isNonTextOutput writerName'
#ifdef _CITEPROC
refs <- if null modsFile then return [] else readModsColletionFile modsFile
refs <- if null biblioFile then return [] else readBiblioFile biblioFile biblioFormat
#endif
let startParserState =

View file

@ -199,7 +199,7 @@ Executable pandoc
if flag(highlighting)
cpp-options: -D_HIGHLIGHTING
if flag(citeproc)
Build-depends: citeproc-hs
Build-depends: citeproc-hs >= 0.2
cpp-options: -D_CITEPROC
if flag(executable)
Buildable: True