Copyright | Copyright (C) 2016-2020 Jesse Rosenthal John MacFarlane |
---|---|
License | GNU GPL, version 2 or above |
Maintainer | Jesse Rosenthal <jrosenthal@jhu.edu> |
Stability | alpha |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Text.Pandoc.Class.IO
Description
Default ways to perform
actions in aPandocMonad
type.MonadIO
These functions are used to make the
type an instance ofPandocIO
, but can be reused for any other MonadIO-conformingtypes.PandocMonad
fileExists :: (PandocMonad m,MonadIO m) =>FilePath -> mBoolSource#
Returns True if file exists.
getCurrentTime ::MonadIO m => mUTCTimeSource#
Get the current (UTC) time.
getCurrentTimeZone ::MonadIO m => mTimeZoneSource#
Get the locale's time zone.
getDataFileName :: (PandocMonad m,MonadIO m) =>FilePath -> mFilePathSource#
Returns the path of data file.
getModificationTime :: (PandocMonad m,MonadIO m) =>FilePath -> mUTCTimeSource#
Return the modification time of a file.
glob :: (PandocMonad m,MonadIO m) =>String -> m [FilePath]Source#
Return a list of paths that match a glob, relative to the working directory. SeeGlob
for the glob syntax.
logOutput :: (PandocMonad m,MonadIO m) =>LogMessage -> m ()Source#
Output a log message.
logIOError :: (PandocMonad m,MonadIO m) =>IO () -> m ()Source#
Show potential IO errors to the user continuing execution anyway
lookupEnv ::MonadIO m =>Text -> m (MaybeText)Source#
Lookup an environment variable in the programs environment.
newUniqueHash ::MonadIO m => mIntSource#
Return a new unique integer.
openURL :: (PandocMonad m,MonadIO m) =>Text -> m (ByteString,MaybeMimeType)Source#
readFileLazy :: (PandocMonad m,MonadIO m) =>FilePath -> mByteStringSource#
Read the lazy ByteString contents from a file path, raising an error on failure.
readFileStrict :: (PandocMonad m,MonadIO m) =>FilePath -> mByteStringSource#
Read the strict ByteString contents from a file path, raising an error on failure.
readStdinStrict :: (PandocMonad m,MonadIO m) => mByteStringSource#
Read the strict ByteString contents from stdin, raising an error on failure.
extractMedia :: (PandocMonad m,MonadIO m) =>FilePath ->Pandoc -> mPandocSource#
Extract media from the mediabag into a directory.
writeMedia :: (PandocMonad m,MonadIO m) =>FilePath -> (FilePath,MimeType,ByteString) -> m ()Source#
Write the contents of a media bag to a path. If the path contains URI escape sequences (percent-encoding), these are resolved.
Produced byHaddock version 2.29.1