Copyright | Copyright (C) 2014-2015 2017–2019 John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | John MacFarlane <jgm@berkeley.edu> |
Stability | alpha |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Definition of a MediaBag object to hold binary resources, and an interface for interacting with it.
Synopsis
- data MediaBag
- lookupMedia :: FilePath -> MediaBag -> Maybe (MimeType, ByteString)
- insertMedia :: FilePath -> Maybe MimeType -> ByteString -> MediaBag -> MediaBag
- mediaDirectory :: MediaBag -> [(String, MimeType, Int)]
Documentation
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 MediaBag
s.
Instances
Data MediaBag Source # | |
Defined in Text.Pandoc.MediaBag gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MediaBag -> c MediaBag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c MediaBag # toConstr :: MediaBag -> Constr # dataTypeOf :: MediaBag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c MediaBag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MediaBag) # gmapT :: (forall b. Data b => b -> b) -> MediaBag -> MediaBag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MediaBag -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MediaBag -> r # gmapQ :: (forall d. Data d => d -> u) -> MediaBag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MediaBag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MediaBag -> m MediaBag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MediaBag -> m MediaBag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MediaBag -> m MediaBag # | |
Show MediaBag Source # | |
Semigroup MediaBag Source # | |
Monoid MediaBag Source # | |
lookupMedia :: FilePath -> MediaBag -> Maybe (MimeType, ByteString) Source #
Lookup a media item in a MediaBag
, returning mime type and contents.