pandoc-2.9.2.1: Conversion between markup formats

Copyright | Copyright (C) 2011-2020 John MacFarlane
License | GNU GPL, version 2 or above
Maintainer | John MacFarlane <jgm@berkeley.edu>
Stability | alpha
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

Text.Pandoc.MIME

Description

Mime type lookup.

Synopsis

- type MimeType = Text
- getMimeType :: FilePath -> Maybe MimeType
- getMimeTypeDef :: FilePath -> MimeType
- extensionFromMimeType :: MimeType -> Maybe Text
- mediaCategory :: FilePath -> Maybe Text

# Documentation

type MimeType = Text Source #

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.

extensionFromMimeType :: MimeType -> Maybe Text Source #

mediaCategory :: FilePath -> Maybe Text Source #

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

    mediaCategory "foo.jpg" = Just "image"