diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-05-07 21:03:18 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-05-07 21:03:18 +0200 |
commit | 6b086acae8f20ad46ca92139e47e516302280e94 (patch) | |
tree | 0b873d2625622260bf64c7ce6ba157df594ebb7d /src/Text/Pandoc | |
parent | a902109c6d56f5249a0521c89ab90ca105b7b023 (diff) | |
download | pandoc-6b086acae8f20ad46ca92139e47e516302280e94.tar.gz |
Rename fillMedia -> fillMediaBag.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/App.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Class.hs | 6 | ||||
-rw-r--r-- | src/Text/Pandoc/PDF.hs | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index 6bc345d73..f340259f3 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -70,7 +70,7 @@ import System.IO.Error (isDoesNotExistError) import Text.Pandoc import Text.Pandoc.Builder (setMeta) import Text.Pandoc.Class (PandocIO, getLog, withMediaBag, - extractMedia, fillMedia) + extractMedia, fillMediaBag) import Text.Pandoc.Highlighting (highlightingStyles) import Text.Pandoc.Lua ( runLuaFilter ) import Text.Pandoc.PDF (makePDF) @@ -414,7 +414,7 @@ convertWithOpts opts = do runIO' $ do (doc, media) <- withMediaBag $ sourceToDoc sources >>= ( (if isJust (optExtractMedia opts) - then fillMedia (writerSourceURL writerOptions) + then fillMediaBag (writerSourceURL writerOptions) else return) >=> maybe return extractMedia (optExtractMedia opts) >=> return . flip (foldr addMetadata) metadata diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index 7407d0799..4ef56ec33 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -61,7 +61,7 @@ module Text.Pandoc.Class ( PandocMonad(..) , runIOorExplode , runPure , withMediaBag - , fillMedia + , fillMediaBag , extractMedia ) where @@ -346,8 +346,8 @@ withPaths (p:ps) action fp = (\_ -> withPaths ps action fp) -- | Traverse tree, filling media bag. -fillMedia :: PandocMonad m => Maybe String -> Pandoc -> m Pandoc -fillMedia sourceURL d = walkM handleImage d +fillMediaBag :: PandocMonad m => Maybe String -> Pandoc -> m Pandoc +fillMediaBag sourceURL d = walkM handleImage d where handleImage :: PandocMonad m => Inline -> m Inline handleImage (Image attr lab (src, tit)) = catchError (do (bs, mt) <- fetchItem sourceURL src diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index 240da3ef0..7097337e2 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -63,7 +63,8 @@ import Text.Pandoc.Writers.Shared (getField, metaToJSON) import Data.List (intercalate) #endif import Text.Pandoc.Class (PandocIO, report, runIO, runIOorExplode, - setMediaBag, setVerbosity, fillMedia, extractMedia) + setMediaBag, setVerbosity, + fillMediaBag, extractMedia) import Text.Pandoc.Logging #ifdef _WINDOWS @@ -138,7 +139,7 @@ handleImages verbosity opts mediabag tmpdir doc = do doc' <- runIOorExplode $ do setVerbosity verbosity setMediaBag mediabag - fillMedia (writerSourceURL opts) doc >>= + fillMediaBag (writerSourceURL opts) doc >>= extractMedia tmpdir walkM (convertImages verbosity tmpdir) doc' |