docs: fix up previous docs change a bit (#362)

This commit is contained in:
TrapinchO 2024-04-03 23:58:36 +02:00 committed by GitHub
parent 7b42b12c5f
commit 97766e8d90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 31 deletions

View File

@ -13,20 +13,18 @@ can print out like this (or in any format you like!):
<img src="https://raw.githubusercontent.com/zkat/miette/main/images/serde_json.png" alt="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: <img src="https://raw.githubusercontent.com/zkat/miette/main/images/serde_json.png" alt="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: Received some bad JSON from the source. Unable to parse.
Error: oops! Caused by: missing field `foo` at line 1 column 1700
\ \
Begin snippet for bad_file.rs starting Begin snippet for https://api.nuget.org/v3/registration5-gz-semver2/json.net/index.json starting
at line 2, column 3 at line 1, column 1659
\ \
snippet line 1: source snippet line 1: gs&quot;:[&quot;json&quot;],&quot;title&quot;:&quot;&quot;,&quot;version&quot;:&quot;1.0.0&quot;},&quot;packageContent&quot;:&quot;https://api.nuget.o
highlight starting at line 1, column 1699: last parsing location
\ \
snippet line 2: text diagnostic help: This is a bug. It might be in ruget, or it might be in the
highlight starting at line 1, column 3: This bit here source you're using, but it's definitely a bug and should be reported.
\ diagnostic error code: ruget::api::bad_json
snippet line 3: here
\
diagnostic help: try doing it better next time?
" /> " />
> **NOTE: You must enable the `"fancy"` crate feature to get fancy report > **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:
<img src="https://raw.githubusercontent.com/zkat/miette/main/images/single-line-example.png" alt=" <img src="https://raw.githubusercontent.com/zkat/miette/main/images/single-line-example.png" alt="
Narratable printout: Narratable printout:
\ \
Error: Types mismatched for operation. diagnostic error code: oops::my::bad (link)
Diagnostic severity: error Error: oops!
Begin snippet starting at line 1, column 1
\ \
snippet line 1: 3 + &quot;5&quot; Begin snippet for bad_file.rs starting
label starting at line 1, column 1: int at line 2, column 3
label starting at line 1, column 1: doesn't support these values. \
label starting at line 1, column 1: string snippet line 1: source
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"> snippet line 2: text
highlight starting at line 1, column 3: This bit here
\
snippet line 3: here
\
diagnostic help: try doing it better next time?">
### Using ### Using

View File

@ -161,17 +161,22 @@
//! <img src="https://raw.githubusercontent.com/zkat/miette/main/images/single-line-example.png" alt=" //! <img src="https://raw.githubusercontent.com/zkat/miette/main/images/single-line-example.png" alt="
//! Narratable printout: //! Narratable printout:
//! \ //! \
//! Error: Types mismatched for operation. //! diagnostic error code: oops::my::bad (link)
//! Diagnostic severity: error //! Error: oops!
//! Begin snippet starting at line 1, column 1 //!
//! \ //! \
//! snippet line 1: 3 + &quot;5&quot; //! Begin snippet for bad_file.rs starting
//! label starting at line 1, column 1: int //! at line 2, column 3
//! label starting at line 1, column 1: doesn't support these values. //! \
//! label starting at line 1, column 1: string //! snippet line 1: source
//! 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"> //! snippet line 2: text
//! highlight starting at line 1, column 3: This bit here
//! \
//! snippet line 3: here
//! \
//! diagnostic help: try doing it better next time?">
//! //!
//! ## Using //! ## Using
//! //!