From 97766e8d90563f8e950de6f6e639815df3375740 Mon Sep 17 00:00:00 2001 From: TrapinchO <67415128+TrapinchO@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:58:36 +0200 Subject: [PATCH] docs: fix up previous docs change a bit (#362) --- README.md | 45 ++++++++++++++++++++++++--------------------- src/lib.rs | 25 +++++++++++++++---------- 2 files changed, 39 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index b58cc94..c019259 100644 --- a/README.md +++ b/README.md @@ -13,20 +13,18 @@ can print out like this (or in any format you like!): Hi! miette also includes a screen-reader-oriented diagnostic printer that's enabled in various situations, such as when you use NO_COLOR or CLICOLOR settings, or on CI. This behavior is also fully configurable and customizable. For example, this is what this particular diagnostic will look like when the narrated printer is enabled:
 \
-diagnostic error code: oops::my::bad (link)
-Error: oops!
-\
-Begin snippet for bad_file.rs starting
-at line 2, column 3
-\
-snippet line 1: source
+Error: Received some bad JSON from the source. Unable to parse.
+    Caused by: missing field `foo` at line 1 column 1700
 \
-snippet line 2:  text
-    highlight starting at line 1, column 3: This bit here
+Begin snippet for https://api.nuget.org/v3/registration5-gz-semver2/json.net/index.json starting
+at line 1, column 1659
 \
-snippet line 3: here
+snippet line 1: gs":["json"],"title":"","version":"1.0.0"},"packageContent":"https://api.nuget.o
+    highlight starting at line 1, column 1699: last parsing location
 \
-diagnostic help: try doing it better next time?
+diagnostic help: This is a bug. It might be in ruget, or it might be in the
+source you're using, but it's definitely a bug and should be reported.
+diagnostic error code: ruget::api::bad_json
 > **NOTE: You must enable the `"fancy"` crate feature to get fancy report @@ -164,17 +162,22 @@ And this is the output you'll get if you run this program: 
 Narratable printout:
 \
-Error: Types mismatched for operation.
-    Diagnostic severity: error
-Begin snippet starting at line 1, column 1
+diagnostic error code: oops::my::bad (link)
+Error: oops!
+
+\
+Begin snippet for bad_file.rs starting
+at line 2, column 3
+\
+snippet line 1: source
+
+\
+snippet line 2:  text
+    highlight starting at line 1, column 3: This bit here
+\
+snippet line 3: here
 \
-snippet line 1: 3 + "5"
-    label starting at line 1, column 1: int
-    label starting at line 1, column 1: doesn't support these values.
-    label starting at line 1, column 1: string
-diagnostic help: Change int or string to be the right types and try again.
-diagnostic code: nu::parser::unsupported_operation
-For more details, see https://docs.rs/nu-parser/0.1.0/nu-parser/enum.ParseError.html#variant.UnsupportedOperation +diagnostic help: try doing it better next time?"> ### Using diff --git a/src/lib.rs b/src/lib.rs index eee1b9a..5301e9e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -161,17 +161,22 @@ //! 
 //! Narratable printout:
 //! \
-//! Error: Types mismatched for operation.
-//!     Diagnostic severity: error
-//! Begin snippet starting at line 1, column 1
+//! diagnostic error code: oops::my::bad (link)
+//! Error: oops!
+//!
+//! \
+//! Begin snippet for bad_file.rs starting
+//! at line 2, column 3
+//! \
+//! snippet line 1: source
+//!
+//! \
+//! snippet line 2:  text
+//!     highlight starting at line 1, column 3: This bit here
+//! \
+//! snippet line 3: here
 //! \
-//! snippet line 1: 3 + "5"
-//!     label starting at line 1, column 1: int
-//!     label starting at line 1, column 1: doesn't support these values.
-//!     label starting at line 1, column 1: string
-//! diagnostic help: Change int or string to be the right types and try again.
-//! diagnostic code: nu::parser::unsupported_operation
-//! For more details, see https://docs.rs/nu-parser/0.1.0/nu-parser/enum.ParseError.html#variant.UnsupportedOperation +//! diagnostic help: try doing it better next time?"> //! //! ## Using //!