From a3c3694024c1cb58748a31983bccdc4a58af567e Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 15 Jan 2017 21:30:20 +0100 Subject: Removed writerMediaBag from WriterOpts. ...since this is now handled through PandocMonad. Added an explicit MediaBag parameter to makePDF and makeSelfContained. --- pandoc.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'pandoc.hs') diff --git a/pandoc.hs b/pandoc.hs index fe9cdba00..3f09660e5 100644 --- a/pandoc.hs +++ b/pandoc.hs @@ -335,7 +335,6 @@ convertWithOpts opts args = do writerEpubChapterLevel = epubChapterLevel, writerTOCDepth = epubTOCDepth, writerReferenceDoc = referenceDoc, - writerMediaBag = mempty, writerVerbose = verbose, writerLaTeXArgs = latexEngineArgs } @@ -394,10 +393,9 @@ convertWithOpts opts args = do applyTransforms transforms >=> applyFilters datadir filters' [format]) doc - let writerOptions' = writerOptions{ writerMediaBag = media } case writer of -- StringWriter f -> f writerOptions doc' >>= writerFn outputFile - ByteStringWriter f -> f writerOptions' doc' >>= writeFnBinary outputFile + ByteStringWriter f -> f writerOptions doc' >>= writeFnBinary outputFile StringWriter f | pdfOutput -> do -- make sure writer is latex or beamer or context or html5 @@ -415,7 +413,7 @@ convertWithOpts opts args = do err 41 $ pdfprog ++ " not found. " ++ pdfprog ++ " is needed for pdf output." - res <- makePDF pdfprog f writerOptions' doc' + res <- makePDF pdfprog f writerOptions media doc' case res of Right pdf -> writeFnBinary outputFile pdf Left err' -> liftIO $ do @@ -426,12 +424,12 @@ convertWithOpts opts args = do let htmlFormat = format `elem` ["html","html5","s5","slidy","slideous","dzslides","revealjs"] selfcontain = if selfContained && htmlFormat - then makeSelfContained writerOptions' + then makeSelfContained writerOptions media else return handleEntities = if htmlFormat && ascii then toEntities else id - output <- f writerOptions' doc' + output <- f writerOptions doc' selfcontain (output ++ ['\n' | not standalone']) >>= writerFn outputFile . handleEntities -- cgit v1.2.3