aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Class.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index 13fdc3e50..12e6f900b 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -101,6 +101,7 @@ class (Functor m, Applicative m, Monad m, MonadError PandocExecutionError m) =>
getWarnings :: m [String]
fail :: String -> m b
glob :: String -> m [FilePath]
+ setMediaBag :: MediaBag -> m ()
insertMedia :: FilePath -> Maybe MimeType -> BL.ByteString -> m ()
--Some functions derived from Primitives:
@@ -175,6 +176,8 @@ instance PandocMonad PandocIO where
liftIO $ IO.warn msg
getWarnings = gets ioStWarnings
glob = liftIO . IO.glob
+ setMediaBag mb =
+ modify $ \st -> st{ioStMediaBag = mb}
insertMedia fp mime bs =
modify $ \st -> st{ioStMediaBag = MB.insertMedia fp mime bs (ioStMediaBag st) }
@@ -299,5 +302,8 @@ instance PandocMonad PandocPure where
fontFiles <- asks envFontFiles
return (filter (match (compile s)) fontFiles)
+ setMediaBag mb =
+ modify $ \st -> st{stMediaBag = mb}
+
insertMedia fp mime bs =
modify $ \st -> st{stMediaBag = MB.insertMedia fp mime bs (stMediaBag st) }