summaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-01-15 21:30:20 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:42 +0100
commita3c3694024c1cb58748a31983bccdc4a58af567e (patch)
tree3e748b3ffd94cd1b769e08168202e73f6eadd7cc /pandoc.hs
parent0bcc81c0b149f1ae3eda7ce72f28199e48744a76 (diff)
Removed writerMediaBag from WriterOpts.
...since this is now handled through PandocMonad. Added an explicit MediaBag parameter to makePDF and makeSelfContained.
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs10
1 files changed, 4 insertions, 6 deletions
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