aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-12-13 21:02:57 -0500
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:42 +0100
commit4b953720c84cec5fb219376a22bb6bc5a0cc0a25 (patch)
treeb2672aef720f59e4151b929e120b84b4804ff2b4 /src
parent55dbc00d55a4136271cd4c4d7ff4ab73d186f4b6 (diff)
downloadpandoc-4b953720c84cec5fb219376a22bb6bc5a0cc0a25.tar.gz
Class: Add insertDeferredMedia function.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Class.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index 836c57b2e..43721a1f1 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -46,6 +46,7 @@ module Text.Pandoc.Class ( PandocMonad(..)
, getMediaBag
, setMediaBag
, insertMedia
+ , insertDeferredMedia
, fetchItem
, getInputFiles
, getOutputFile
@@ -147,6 +148,12 @@ insertMedia fp mime bs = do
let mb' = MB.insertMedia fp mime bs mb
modifyCommonState $ \st -> st{stDeferredMediaBag =DeferredMediaBag mb' dm }
+insertDeferredMedia :: PandocMonad m => FilePath -> m ()
+insertDeferredMedia fp = do
+ (DeferredMediaBag mb dm) <- getsCommonState stDeferredMediaBag
+ modifyCommonState $
+ \st -> st{stDeferredMediaBag = DeferredMediaBag mb ((DeferredMediaPath fp) : dm)}
+
getInputFiles :: PandocMonad m => m (Maybe [FilePath])
getInputFiles = getsCommonState stInputFiles