diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-01-22 12:19:46 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-01-25 17:07:43 +0100 |
commit | 8280d6a48958ef305e3dd29e2bb189fb1ea96b14 (patch) | |
tree | 07c88af7b2c814239f5be5c31ea8ac850e8ea70d /src/Text/Pandoc/Options.hs | |
parent | d1efc839f129d23fe8a6523e33a01b0b463ee409 (diff) |
Changes to verbosity in writer and reader options.
API changes: Text.Pandoc.Options:
* Added Verbosity.
* Added writerVerbosity.
* Added readerVerbosity.
* Removed writerVerbose.
* Removed readerTrace.
pandoc CLI: The `--trace` option sets verbosity to DEBUG;
the `--quiet` option sets it to ERROR, and the `--verbose`
option sets it to INFO. The default is WARNING.
Diffstat (limited to 'src/Text/Pandoc/Options.hs')
-rw-r--r-- | src/Text/Pandoc/Options.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs index e7dec6492..262a0392d 100644 --- a/src/Text/Pandoc/Options.hs +++ b/src/Text/Pandoc/Options.hs @@ -37,6 +37,7 @@ module Text.Pandoc.Options ( module Text.Pandoc.Extensions , HTMLSlideVariant (..) , EPUBVersion (..) , WrapOption (..) + , Verbosity (..) , TopLevelDivision (..) , WriterOptions (..) , TrackChanges (..) @@ -61,7 +62,7 @@ data ReaderOptions = ReaderOptions{ , readerIndentedCodeClasses :: [String] -- ^ Default classes for -- indented code blocks , readerDefaultImageExtension :: String -- ^ Default extension for images - , readerTrace :: Bool -- ^ Print debugging info + , readerVerbosity :: Verbosity -- ^ Verbosity level , readerTrackChanges :: TrackChanges } deriving (Show, Read, Data, Typeable, Generic) @@ -75,7 +76,7 @@ instance Default ReaderOptions , readerApplyMacros = True , readerIndentedCodeClasses = [] , readerDefaultImageExtension = "" - , readerTrace = False + , readerVerbosity = ERROR , readerTrackChanges = AcceptChanges } @@ -141,6 +142,10 @@ data ReferenceLocation = EndOfBlock -- ^ End of block | EndOfDocument -- ^ at end of document deriving (Show, Read, Eq, Data, Typeable, Generic) +-- | Verbosity level. +data Verbosity = ERROR | WARNING | INFO | DEBUG + deriving (Show, Read, Eq, Data, Enum, Ord, Bounded, Typeable, Generic) + -- | Options for writers data WriterOptions = WriterOptions { writerTemplate :: Maybe String -- ^ Template to use @@ -181,7 +186,7 @@ data WriterOptions = WriterOptions , writerEpubChapterLevel :: Int -- ^ Header level for chapters (separate files) , writerTOCDepth :: Int -- ^ Number of levels to include in TOC , writerReferenceDoc :: Maybe FilePath -- ^ Path to reference document if specified - , writerVerbose :: Bool -- ^ Verbose debugging output + , writerVerbosity :: Verbosity -- ^ Verbose debugging output , writerLaTeXArgs :: [String] -- ^ Flags to pass to latex-engine , writerReferenceLocation :: ReferenceLocation -- ^ Location of footnotes and references for writing markdown } deriving (Show, Data, Typeable, Generic) @@ -223,7 +228,7 @@ instance Default WriterOptions where , writerEpubChapterLevel = 1 , writerTOCDepth = 3 , writerReferenceDoc = Nothing - , writerVerbose = False + , writerVerbosity = WARNING , writerLaTeXArgs = [] , writerReferenceLocation = EndOfDocument } |