pandoc-1.13: Conversion between markup formats

MaintainerJohn MacFarlane <>
Safe HaskellNone



Definition of a MediaBag object to hold binary resources, and an interface for interacting with it.



data MediaBag Source

A container for a collection of binary resources, with names and mime types. Note that a MediaBag is a Monoid, so mempty can be used for an empty MediaBag, and <> can be used to append two MediaBags.

lookupMedia :: FilePath -> MediaBag -> Maybe (String, ByteString)Source

Lookup a media item in a MediaBag, returning mime type and contents.



:: FilePath

relative path and canonical name of resource

-> Maybe String

mime type (Nothing = determine from extension)

-> ByteString

contents of resource

-> MediaBag 
-> MediaBag 

Insert a media item into a MediaBag, replacing any existing value with the same name.

mediaDirectory :: MediaBag -> [(String, String, Int)]Source

Get a list of the file paths stored in a MediaBag, with their corresponding mime types and the lengths in bytes of the contents.

extractMediaBag :: Bool -> FilePath -> MediaBag -> IO ()Source

Extract contents of MediaBag to a given directory. Print informational messages if verbose is true.