From 08bf5ffbdfd8df51f61ba882114cc75b639713e8 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 13 Dec 2019 17:18:32 +0900 Subject: [PATCH] doc: put screenshot to colorize-error-message --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.md b/README.md index b9d5d31..20537ba 100644 --- a/README.md +++ b/README.md @@ -1361,6 +1361,39 @@ By defining `TOML11_COLORIZE_ERROR_MESSAGE`, the error messages from `toml::parse` and `toml::find|get` will be colorized. By default, this feature is turned off. +With the following toml file taken from `toml-lang/toml/tests/hard_example.toml`, + +```toml +[error] +array = [ + "This might most likely happen in multiline arrays", + Like here, + "or here, + and here" + ] End of array comment, forgot the # +``` + +the error message would be like this. + +![error-message-1](https://github.com/ToruNiina/toml11/blob/misc/misc/toml11-err-msg-1.png) + +With the following, + +```toml +[error] +# array = [ +# "This might most likely happen in multiline arrays", +# Like here, +# "or here, +# and here" +# ] End of array comment, forgot the # +number = 3.14 pi <--again forgot the # +``` + +the error message would be like this. + +![error-message-2](https://github.com/ToruNiina/toml11/blob/misc/misc/toml11-err-msg-2.png) + The message would be messy when it is written to a file, not a terminal because it uses [ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code).