git.iko.soy/typeable/pandoc
on master help sign in
More pleasing presentation of warnings and info messages.

!! warning -- info

commit1a82ecbb6866a00689e3220d304a0fafd81358bb authorJohn MacFarlane <jgm@berkeley.edu> dateMon 23 Oct 2017, 15:00 (9 years ago) parenta27dc79
4 files changed+10−9
src/Text/Pandoc/Class.hs+5−4 test/command/1718.md+1−1 test/command/512.md+1−1 test/command/svg.md+3−3
src/Text/Pandoc/Class.hs+5−4
@@ -111,7 +111,6 @@ import Text.Parsec (ParsecT, getPosition, sourceLine, sourceName)
111111import qualified Text.Pandoc.Compat.Time as IO (getCurrentTime)
112112import Text.Pandoc.MIME (MimeType, getMimeType, extensionFromMimeType)
113113import Text.Pandoc.Definition
114−import Data.Char (toLower)
115114import Data.Digest.Pure.SHA (sha1, showDigest)
116115import Data.Maybe (fromMaybe)
117116import Data.Time.Clock.POSIX ( utcTimeToPOSIXSeconds
@@ -513,8 +512,10 @@ instance PandocMonad PandocIO where
513512 getCommonState = PandocIO $ lift get
514513 putCommonState x = PandocIO $ lift $ put x
515514 logOutput msg = liftIO $ do
516− UTF8.hPutStr stderr $ "[" ++
517− map toLower (show (messageVerbosity msg)) ++ "] "
515+ UTF8.hPutStr stderr $
516+ case messageVerbosity msg of
517+ WARNING -> "!! "
518+ _ -> ".. "
518519 alertIndent $ lines $ showLogMessage msg
519520
520521alertIndent :: [String] -> IO ()
@@ -522,7 +523,7 @@ alertIndent [] = return ()
522523alertIndent (l:ls) = do
523524 UTF8.hPutStrLn stderr l
524525 mapM_ go ls
525− where go l' = do UTF8.hPutStr stderr "! "
526+ where go l' = do UTF8.hPutStr stderr " "
526527 UTF8.hPutStrLn stderr l'
527528
528529-- | Specialized version of parseURIReference that disallows
test/command/1718.md+1−1
@@ -6,6 +6,6 @@ Note[^1].
66
77[^2]: the second, unused, note.
88^D
9−[warning] Note with key '2' defined at line 5 column 1 but not used.
9+!! Note with key '2' defined at line 5 column 1 but not used.
1010[Para [Str "Note",Note [Para [Str "the",Space,Str "first",Space,Str "note."]],Str "."]]
1111```
test/command/512.md+1−1
@@ -36,7 +36,7 @@ Loop detection:
3636
3737__ link1_
3838^D
39−[warning] Circular reference 'link1' at line 1 column 15
39+!! Circular reference 'link1' at line 1 column 15
4040<p><a href="">click here</a></p>
4141```
4242
test/command/svg.md+3−3
@@ -2,7 +2,7 @@
22% pandoc -f latex -t icml
33\includegraphics{command/corrupt.svg}
44^D
5−[warning] Could not determine image size for 'command/corrupt.svg': could not determine image type
5+!! Could not determine image size for 'command/corrupt.svg': could not determine image type
66<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
77 <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
88 <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">
@@ -35,7 +35,7 @@
3535% pandoc -f latex -t icml
3636\includegraphics{command/SVG_logo.svg}
3737^D
38−[warning] Could not determine image size for 'command/SVG_logo.svg': could not determine SVG size
38+!! Could not determine image size for 'command/SVG_logo.svg': could not determine SVG size
3939<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
4040 <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
4141 <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">
@@ -68,7 +68,7 @@
6868% pandoc -f latex -t icml
6969\includegraphics{command/SVG_logo-without-xml-declaration.svg}
7070^D
71−[warning] Could not determine image size for 'command/SVG_logo-without-xml-declaration.svg': could not determine SVG size
71+!! Could not determine image size for 'command/SVG_logo-without-xml-declaration.svg': could not determine SVG size
7272<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
7373 <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
7474 <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 150 -100">