@@ -43,7 +43,6 @@ import System.Environment ( getArgs, getProgName )
4343import System.Exit ( exitWith, ExitCode (..) )
4444import System.FilePath
4545import System.Console.GetOpt
46−import System.Process (readProcess)
4746import Data.Char ( toLower )
4847import Data.List ( intercalate, isPrefixOf, sort )
4948import System.Directory ( getAppUserDataDirectory, doesFileExist, findExecutable )
@@ -54,7 +53,6 @@ import Control.Exception.Extensible ( throwIO )
5453import qualified Text.Pandoc.UTF8 as UTF8
5554import qualified Text.CSL as CSL
5655import Control.Monad (when, unless, liftM)
57−import Data.Foldable (foldrM)
5856import Network.HTTP (simpleHTTP, mkRequest, getResponseBody, RequestMethod(..))
5957import Network.URI (parseURI, isURI, URI(..))
6058import qualified Data.ByteString.Lazy as B
@@ -88,12 +86,6 @@ wrapWords indent c = wrap' (c - indent) (c - indent)
8886isTextFormat :: String -> Bool
8987isTextFormat s = takeWhile (`notElem` "+-") s `notElem` ["odt","docx","epub","epub3"]
9088
91−externalFilter :: FilePath -> Pandoc -> IO Pandoc
92−externalFilter f d = E.catch
93− (readJSON def `fmap` readProcess f [] (writeJSON def d))
94− (\e -> let _ = (e :: E.SomeException)
95− in err 83 $ "Error running filter `" ++ f ++ "'")
96−
9789-- | Data structure for command line options.
9890data Opt = Opt
9991 { optTabStop :: Int -- ^ Number of spaces per tab
@@ -280,13 +272,6 @@ options =
280272 "STRING")
281273 "" -- "Classes (whitespace- or comma-separated) to use for indented code-blocks"
282274
283− , Option "" ["filter"]
284− (ReqArg
285− (\arg opt -> return opt { optPlugins = externalFilter arg :
286− optPlugins opt })
287− "PROGRAM")
288− "" -- "External JSON filter"
289−
290275 , Option "" ["normalize"]
291276 (NoArg
292277 (\opt -> return opt { optTransforms =
@@ -891,7 +876,6 @@ main = do
891876 , optReferenceLinks = referenceLinks
892877 , optWrapText = wrap
893878 , optColumns = columns
894− , optPlugins = plugins
895879 , optEmailObfuscation = obfuscationMethod
896880 , optIdentifierPrefix = idPrefix
897881 , optIndentedCodeClasses = codeBlockClasses
@@ -1115,7 +1099,6 @@ main = do
11151099 reader readerOpts
11161100
11171101 let doc0 = foldr ($) doc transforms
1118− doc1 <- foldrM ($) doc0 plugins
11191102
11201103 let writeBinary :: B.ByteString -> IO ()
11211104 writeBinary = B.writeFile (UTF8.encodePath outputFile)
@@ -1126,15 +1109,15 @@ main = do
11261109
11271110 case getWriter writerName' of
11281111 Left e -> err 9 e
1129− Right (IOStringWriter f) -> f writerOptions doc1 >>= writerFn outputFile
1130− Right (IOByteStringWriter f) -> f writerOptions doc1 >>= writeBinary
1112+ Right (IOStringWriter f) -> f writerOptions doc0 >>= writerFn outputFile
1113+ Right (IOByteStringWriter f) -> f writerOptions doc0 >>= writeBinary
11311114 Right (PureStringWriter f)
11321115 | pdfOutput -> do
1133− res <- makePDF latexEngine f writerOptions doc1
1116+ res <- makePDF latexEngine f writerOptions doc0
11341117 case res of
11351118 Right pdf -> writeBinary pdf
11361119 Left err' -> err 43 $ UTF8.toStringLazy err'
1137− | otherwise -> selfcontain (f writerOptions doc1 ++
1120+ | otherwise -> selfcontain (f writerOptions doc0 ++
11381121 ['\n' | not standalone'])
11391122 >>= writerFn outputFile . handleEntities
11401123 where htmlFormat = writerName' `elem`