aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL21
-rw-r--r--pandoc.cabal14
-rw-r--r--src/pandoc.hs18
3 files changed, 3 insertions, 50 deletions
diff --git a/INSTALL b/INSTALL
index f405e2c4a..ea47c94e6 100644
--- a/INSTALL
+++ b/INSTALL
@@ -73,8 +73,6 @@ you will need [zip-archive] and (if you want syntax highlighting)
- `wrappers`: build the wrapper `markdown2pdf` (default yes)
- `highlighting`: compile with syntax highlighting support (increases
the size of the executable) (default no)
- - `citeproc`: compile with bibliographic support using `citeproc-hs`
- (default no)
So, for example,
@@ -109,22 +107,3 @@ you will need [zip-archive] and (if you want syntax highlighting)
[highlighting-kate]: http://hackage.haskell.org/package/highlighting-kate
[Cabal User's Guide]: http://www.haskell.org/cabal/release/latest/doc/users-guide/builders.html#setup-configure-paths
-Optional citeproc support
--------------------------
-
-Pandoc can optionally be compiled with support for bibliographic citations
-using Andrea Rossato's [`citeproc-hs` library]. This allows you
-to specify citations in markdown using an intuitive syntax (for example,
-`[jones2005@p. 3; smith2006]`). These are automatically changed into
-appropriately styled citations in the output, and a bibliography is
-added. The bibliography data and style information are taken from XML
-files that must be specified on the command line. (Note: `citeproc-hs`
-support is experimental, and the interface may change in the future.)
-
-If you are using Cabal to compile pandoc, specify the `citeproc` flag in
-the configure step:
-
- runhaskell Setup configure --flags="citeproc"
-
-[`citeproc-hs` library]: http://code.haskell.org/citeproc-hs/
-
diff --git a/pandoc.cabal b/pandoc.cabal
index 368fbb065..456e81790 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -145,9 +145,6 @@ Flag library
Flag wrappers
Description: Build the wrappers (markdown2pdf).
Default: True
-Flag citeproc
- Description: Compile in support for citeproc-hs bibliographic formatting.
- Default: True
Library
-- Note: the following material must be in both Library and Executable stanzas.
@@ -161,6 +158,7 @@ Library
utf8-string >= 0.3, old-time >= 1,
HTTP >= 4000.0.5, texmath >= 0.4, xml >= 1.3.5 && < 1.4,
random, extensible-exceptions,
+ citeproc-hs >= 0.3 && < 0.4,
pandoc-types == 1.7.*
if impl(ghc >= 6.10)
Build-depends: base >= 4 && < 5, syb
@@ -169,9 +167,6 @@ Library
if flag(highlighting)
Build-depends: highlighting-kate >= 0.2.7.1
cpp-options: -D_HIGHLIGHTING
- if flag(citeproc)
- Build-depends: citeproc-hs >= 0.3 && < 0.4
- cpp-options: -D_CITEPROC
if impl(ghc >= 6.12)
Ghc-Options: -O2 -Wall -fno-warn-unused-do-bind
else
@@ -208,13 +203,12 @@ Library
Text.Pandoc.Writers.EPUB,
Text.Pandoc.S5,
Text.Pandoc.Templates
+ Text.Pandoc.Biblio
Other-Modules: Text.Pandoc.XML,
Text.Pandoc.UTF8,
Text.Pandoc.UUID,
Paths_pandoc
- if flag(citeproc)
- Exposed-Modules: Text.Pandoc.Biblio
if flag(library)
Buildable: True
else
@@ -232,6 +226,7 @@ Executable pandoc
utf8-string >= 0.3, old-time >= 1,
HTTP >= 4000.0.5, texmath, xml >= 1.3.5 && < 1.4,
random, extensible-exceptions,
+ citeproc-hs >= 0.3 && < 0.4,
pandoc-types == 1.7.*
if impl(ghc >= 6.10)
Build-depends: base >= 4 && < 5, syb
@@ -240,9 +235,6 @@ Executable pandoc
if flag(highlighting)
Build-depends: highlighting-kate >= 0.2.7.1
cpp-options: -D_HIGHLIGHTING
- if flag(citeproc)
- Build-depends: citeproc-hs >= 0.3 && < 0.4
- cpp-options: -D_CITEPROC
if impl(ghc >= 6.12)
Ghc-Options: -O2 -Wall -fno-warn-unused-do-bind
else
diff --git a/src/pandoc.hs b/src/pandoc.hs
index 66a09b309..f671f3155 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -45,10 +45,8 @@ import Data.List ( intercalate, isSuffixOf )
import System.Directory ( getAppUserDataDirectory )
import System.IO ( stdout, stderr )
import qualified Text.Pandoc.UTF8 as UTF8
-#ifdef _CITEPROC
import Text.CSL
import Text.Pandoc.Biblio
-#endif
import Control.Monad (when, unless, liftM)
import Network.HTTP (simpleHTTP, mkRequest, getResponseBody, RequestMethod(..))
import Network.URI (parseURI, isURI, URI(..))
@@ -64,9 +62,7 @@ copyrightMessage = "\nCopyright (C) 2006-2010 John MacFarlane\n" ++
compileInfo :: String
compileInfo =
-#ifdef _CITEPROC
"\nCompiled with citeproc support." ++
-#endif
#ifdef _HIGHLIGHTING
"\nCompiled with syntax highlighting support for:\n" ++
wrapWords 78 languages ++
@@ -162,10 +158,8 @@ data Opt = Opt
, optIdentifierPrefix :: String
, optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
, optDataDir :: Maybe FilePath
-#ifdef _CITEPROC
, optBibliography :: [Reference]
, optCslFile :: FilePath
-#endif
}
-- | Defaults for command-line options.
@@ -203,10 +197,8 @@ defaultOpts = Opt
, optIdentifierPrefix = ""
, optIndentedCodeClasses = []
, optDataDir = Nothing
-#ifdef _CITEPROC
, optBibliography = []
, optCslFile = ""
-#endif
}
-- | A list of functions, each transforming the options data structure
@@ -517,7 +509,6 @@ options =
exitWith ExitSuccess)
"FORMAT")
"" -- "Print default template for FORMAT"
-#ifdef _CITEPROC
, Option "" ["bibliography"]
(ReqArg
(\arg opt -> do
@@ -535,7 +526,6 @@ options =
(\arg opt -> return opt { optCslFile = arg })
"FILENAME")
""
-#endif
, Option "" ["data-dir"]
(ReqArg
(\arg opt -> return opt { optDataDir = Just arg })
@@ -683,10 +673,8 @@ main = do
, optIdentifierPrefix = idPrefix
, optIndentedCodeClasses = codeBlockClasses
, optDataDir = mbDataDir
-#ifdef _CITEPROC
, optBibliography = refs
, optCslFile = cslfile
-#endif
} = opts
when dumpArgs $
@@ -783,9 +771,7 @@ main = do
stateLiterateHaskell = "+lhs" `isSuffixOf` readerName' ||
lhsExtension sources,
stateStandalone = standalone',
-#ifdef _CITEPROC
stateCitations = map refId refs,
-#endif
stateSmart = smart || writerName' `elem`
["latex", "context", "latex+lhs", "man"],
stateColumns = columns,
@@ -843,7 +829,6 @@ main = do
let doc' = foldr ($) doc transforms
doc'' <- do
-#ifdef _CITEPROC
if null refs
then return doc'
else do
@@ -851,9 +836,6 @@ main = do
then findDataFile datadir "default.csl"
else return cslfile
processBiblio cslfile' refs doc'
-#else
- return doc'
-#endif
writerOutput <- writer writerOptions doc''