git.iko.soy/typeable/pandoc
on master help sign in
`--bibliography` again implies `-F pandoc-citeproc`.

But only if pandoc-citeproc isn't already specified as a filter.

commitd47eadaf5645a807385f62b5b265274594182967 authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 10 Sep 2013, 20:23 (13 years ago) parent96f64c7
2 files changed+14−7
README+3−2 pandoc.hs+11−5
README+3−2
@@ -606,8 +606,9 @@ Citation rendering
606606
607607`--bibliography=`*FILE*
608608: Set the `bibliography` field in the document's metadata to *FILE*,
609− overriding any value set in the metadata. (This is equivalent to
610− `--metadata bibliography=FILE`.)
609+ overriding any value set in the metadata, and process citations
610+ using `pandoc-citeproc`. (This is equivalent to
611+ `--metadata bibliography=FILE --filter pandoc-citeproc`.)
611612
612613`--csl=`*FILE*
613614: Set the `csl` field in the document's metadata to *FILE*,
pandoc.hs+11−5
@@ -140,7 +140,7 @@ data Opt = Opt
140140 , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
141141 , optWrapText :: Bool -- ^ Wrap text
142142 , optColumns :: Int -- ^ Line length in characters
143− , optPlugins :: [[String] -> Pandoc -> IO Pandoc] -- ^ Plugins to apply
143+ , optFilters :: [FilePath] -- ^ Filters to apply
144144 , optEmailObfuscation :: ObfuscationMethod
145145 , optIdentifierPrefix :: String
146146 , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
@@ -195,7 +195,7 @@ defaultOpts = Opt
195195 , optReferenceLinks = False
196196 , optWrapText = True
197197 , optColumns = 72
198− , optPlugins = []
198+ , optFilters = []
199199 , optEmailObfuscation = JavascriptObfuscation
200200 , optIdentifierPrefix = ""
201201 , optIndentedCodeClasses = []
@@ -285,8 +285,7 @@ options =
285285
286286 , Option "F" ["filter"]
287287 (ReqArg
288− (\arg opt -> return opt { optPlugins = externalFilter arg :
289− optPlugins opt })
288+ (\arg opt -> return opt { optFilters = arg : optFilters opt })
290289 "PROGRAM")
291290 "" -- "External JSON filter"
292291
@@ -913,7 +912,7 @@ main = do
913912 , optReferenceLinks = referenceLinks
914913 , optWrapText = wrap
915914 , optColumns = columns
916− , optPlugins = plugins
915+ , optFilters = filters
917916 , optEmailObfuscation = obfuscationMethod
918917 , optIdentifierPrefix = idPrefix
919918 , optIndentedCodeClasses = codeBlockClasses
@@ -933,6 +932,13 @@ main = do
933932 mapM_ (\arg -> UTF8.hPutStrLn stdout arg) args
934933 exitWith ExitSuccess
935934
935+ -- --bibliography implies -F pandoc-citeproc for backwards compatibility:
936+ let filters' = case lookup "bibliography" metadata of
937+ Just _ | "pandoc-citeproc" `notElem` filters ->
938+ "pandoc-citeproc" : filters
939+ _ -> filters
940+ let plugins = map externalFilter filters'
941+
936942 let sources = if ignoreArgs then [] else args
937943
938944 datadir <- case mbDataDir of