git.iko.soy/typeable/pandoc
on master help sign in
Replaced --biblio-file with --bibliography, removed --biblio-format.

Bibliography format is guessed from the file extension of the bibliography. Also, the bibliography entries are now read during option parsing.

commit7aecddd0f7c22ed2beb1ccf268d3b0e8b2d08831 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 13 Nov 2010, 08:42 (16 years ago) parent1fa2973
2 files changed+10−19
src/pandoc.hs+9−18 tests/RunTests.hs+1−1
src/pandoc.hs+9−18
@@ -163,8 +163,7 @@ data Opt = Opt
163163 , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
164164 , optDataDir :: Maybe FilePath
165165#ifdef _CITEPROC
166− , optBiblioFile :: String
167− , optBiblioFormat :: String
166+ , optBibliography :: [Reference]
168167 , optCslFile :: String
169168#endif
170169 }
@@ -205,8 +204,7 @@ defaultOpts = Opt
205204 , optIndentedCodeClasses = []
206205 , optDataDir = Nothing
207206#ifdef _CITEPROC
208− , optBiblioFile = []
209− , optBiblioFormat = []
207+ , optBibliography = []
210208 , optCslFile = []
211209#endif
212210 }
@@ -520,16 +518,14 @@ options =
520518 "FORMAT")
521519 "" -- "Print default template for FORMAT"
522520#ifdef _CITEPROC
523− , Option "" ["biblio"]
521+ , Option "" ["bibliography"]
524522 (ReqArg
525− (\arg opt -> return opt { optBiblioFile = arg} )
523+ (\arg opt -> do
524+ refs <- readBiblioFile arg ""
525+ return opt { optBibliography =
526+ optBibliography opt ++ refs } )
526527 "FILENAME")
527528 ""
528− , Option "" ["biblio-format"]
529− (ReqArg
530− (\arg opt -> return opt { optBiblioFormat = arg} )
531− "STRING")
532− ""
533529 , Option "" ["csl"]
534530 (ReqArg
535531 (\arg opt -> return opt { optCslFile = arg} )
@@ -684,9 +680,8 @@ main = do
684680 , optIndentedCodeClasses = codeBlockClasses
685681 , optDataDir = mbDataDir
686682#ifdef _CITEPROC
687− , optBiblioFile = biblioFile
688− , optBiblioFormat = biblioFormat
689− , optCslFile = cslFile
683+ , optBibliography = refs
684+ , optCslFile = cslFile
690685#endif
691686 } = opts
692687
@@ -746,10 +741,6 @@ main = do
746741
747742 let standalone' = standalone || isNonTextOutput writerName'
748743
749−#ifdef _CITEPROC
750− refs <- if null biblioFile then return [] else readBiblioFile biblioFile biblioFormat
751−#endif
752−
753744 variables' <- case (writerName', standalone', offline) of
754745 ("s5", True, True) -> do
755746 inc <- s5HeaderIncludes datadir
tests/RunTests.hs+1−1
@@ -106,7 +106,7 @@ main = do
106106 "latex-reader.latex" "latex-reader.native"
107107 r11 <- runTest "native reader" ["-r", "native", "-w", "native", "-s"]
108108 "testsuite.native" "testsuite.native"
109− r14 <- runTest "markdown reader (citations)" ["-r", "markdown", "-w", "plain", "--biblio", "biblio.bib", "--csl", "chicago-author-date.csl"] "markdown-citations.txt" "markdown-citations.plain"
109+ r14 <- runTest "markdown reader (citations)" ["-r", "markdown", "-w", "plain", "--bibliography", "biblio.bib", "--csl", "chicago-author-date.csl"] "markdown-citations.txt" "markdown-citations.plain"
110110 r12s <- if runLhsTests
111111 then mapM runLhsWriterTest lhsWriterFormats
112112 else putStrLn "Skipping lhs writer tests because they presuppose highlighting support" >> return []