Skip to content

Commit 97766e8

Browse files
authored
docs: fix up previous docs change a bit (#362)
1 parent 7b42b12 commit 97766e8

File tree

2 files changed

+39
-31
lines changed

2 files changed

+39
-31
lines changed

README.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,18 @@ can print out like this (or in any format you like!):
1313

1414
<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:
1515
\
16-
diagnostic error code: oops::my::bad (link)
17-
Error: oops!
18-
\
19-
Begin snippet for bad_file.rs starting
20-
at line 2, column 3
21-
\
22-
snippet line 1: source
16+
Error: Received some bad JSON from the source. Unable to parse.
17+
Caused by: missing field `foo` at line 1 column 1700
2318
\
24-
snippet line 2: text
25-
highlight starting at line 1, column 3: This bit here
19+
Begin snippet for https://api.nuget.org/v3/registration5-gz-semver2/json.net/index.json starting
20+
at line 1, column 1659
2621
\
27-
snippet line 3: here
22+
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
23+
highlight starting at line 1, column 1699: last parsing location
2824
\
29-
diagnostic help: try doing it better next time?
25+
diagnostic help: This is a bug. It might be in ruget, or it might be in the
26+
source you're using, but it's definitely a bug and should be reported.
27+
diagnostic error code: ruget::api::bad_json
3028
" />
3129

3230
> **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:
164162
<img src="https://raw.githubusercontent.com/zkat/miette/main/images/single-line-example.png" alt="
165163
Narratable printout:
166164
\
167-
Error: Types mismatched for operation.
168-
Diagnostic severity: error
169-
Begin snippet starting at line 1, column 1
165+
diagnostic error code: oops::my::bad (link)
166+
Error: oops!
167+
168+
\
169+
Begin snippet for bad_file.rs starting
170+
at line 2, column 3
171+
\
172+
snippet line 1: source
173+
174+
\
175+
snippet line 2: text
176+
highlight starting at line 1, column 3: This bit here
177+
\
178+
snippet line 3: here
170179
\
171-
snippet line 1: 3 + &quot;5&quot;
172-
label starting at line 1, column 1: int
173-
label starting at line 1, column 1: doesn't support these values.
174-
label starting at line 1, column 1: string
175-
diagnostic help: Change int or string to be the right types and try again.
176-
diagnostic code: nu::parser::unsupported_operation
177-
For more details, see https://docs.rs/nu-parser/0.1.0/nu-parser/enum.ParseError.html#variant.UnsupportedOperation">
180+
diagnostic help: try doing it better next time?">
178181

179182
### Using
180183

src/lib.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,22 @@
161161
//! <img src="https://raw.githubusercontent.com/zkat/miette/main/images/single-line-example.png" alt="
162162
//! Narratable printout:
163163
//! \
164-
//! Error: Types mismatched for operation.
165-
//! Diagnostic severity: error
166-
//! Begin snippet starting at line 1, column 1
164+
//! diagnostic error code: oops::my::bad (link)
165+
//! Error: oops!
166+
//!
167+
//! \
168+
//! Begin snippet for bad_file.rs starting
169+
//! at line 2, column 3
170+
//! \
171+
//! snippet line 1: source
172+
//!
173+
//! \
174+
//! snippet line 2: text
175+
//! highlight starting at line 1, column 3: This bit here
176+
//! \
177+
//! snippet line 3: here
167178
//! \
168-
//! snippet line 1: 3 + &quot;5&quot;
169-
//! label starting at line 1, column 1: int
170-
//! label starting at line 1, column 1: doesn't support these values.
171-
//! label starting at line 1, column 1: string
172-
//! diagnostic help: Change int or string to be the right types and try again.
173-
//! diagnostic code: nu::parser::unsupported_operation
174-
//! For more details, see https://docs.rs/nu-parser/0.1.0/nu-parser/enum.ParseError.html#variant.UnsupportedOperation">
179+
//! diagnostic help: try doing it better next time?">
175180
//!
176181
//! ## Using
177182
//!

0 commit comments

Comments
 (0)