pandoc-2.15: Conversion between markup formats
CopyrightCopyright (C) 2011-2021 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.Pandoc.MIME

Description

Mime type lookup.

Synopsis

Documentation

getMimeType :: FilePath -> Maybe MimeType Source #

Determine mime type appropriate for file path.

getMimeTypeDef :: FilePath -> MimeType Source #

Determime mime type appropriate for file path, defaulting to “application/octet-stream” if nothing else fits.

getCharset :: MimeType -> Maybe Text Source #

Get the charset from a mime type, if one is present.

mediaCategory :: FilePath -> Maybe Text Source #

Determine general media category for file path, e.g.

mediaCategory "foo.jpg" = Just "image"