diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-12-03 17:10:50 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-01-25 17:07:40 +0100 |
commit | 2710fc426130738715fdf1ac6dd0c111a5ac8340 (patch) | |
tree | 4ed0e0002848c83432dd9b4c791734f622448519 /src/Text/Pandoc/Class.hs | |
parent | 5ab8909661242d992726411d6adc6490eacaafe3 (diff) | |
download | pandoc-2710fc426130738715fdf1ac6dd0c111a5ac8340.tar.gz |
Class: Renamed 'warn' to 'addWarning' and consolidated RTF writer.
* Renaming Text.Pandoc.Class.warn to addWarning avoids conflict
with Text.Pandoc.Shared.warn.
* Removed writeRTFWithEmbeddedImages from Text.Pandoc.Writers.RTF.
This is no longer needed; we automatically handle embedded images
using the PandocM functions. [API change]
Diffstat (limited to 'src/Text/Pandoc/Class.hs')
-rw-r--r-- | src/Text/Pandoc/Class.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index 1059f5324..3337de40a 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -36,14 +36,14 @@ module Text.Pandoc.Class ( PandocMonad(..) , PureState(..) , getPOSIXTime , getZonedTime - , warn + , addWarning + , addWarningWithPos , getWarnings , getMediaBag , setMediaBag , insertMedia , getInputFiles , getOutputFile - , addWarningWithPos , PandocIO(..) , PandocPure(..) , FileInfo(..) @@ -121,10 +121,8 @@ class (Functor m, Applicative m, Monad m, MonadError PandocError m, MonadState C -- Functions defined for all PandocMonad instances --- TODO should we rename this to avoid conflict with the like-named --- function from Shared? Perhaps "addWarning"? -warn :: PandocMonad m => String -> m () -warn msg = modify $ \st -> st{stWarnings = msg : stWarnings st} +addWarning :: PandocMonad m => String -> m () +addWarning msg = modify $ \st -> st{stWarnings = msg : stWarnings st} getWarnings :: PandocMonad m => m [String] getWarnings = gets stWarnings @@ -160,7 +158,7 @@ addWarningWithPos :: PandocMonad m -> ParserT [Char] ParserState m () addWarningWithPos mbpos msg = lift $ - warn $ + addWarning $ msg ++ maybe "" (\pos -> " " ++ show pos) mbpos -- |