Skip to content

Commit

Permalink
Fix all doc links
Browse files Browse the repository at this point in the history
  • Loading branch information
yaahc committed Apr 25, 2020
1 parent 3edc5c8 commit 4e85352
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
color-eyre
----------

A custom context for the `eyre` crate for colorful error reports, suggestions,
and `tracing_error` support.
A custom context for the [`eyre`] crate for colorful error reports, suggestions,
and [`tracing-error`] support.

This crate is currently pre-release while I try to upstream changes I made to
`color-backtrace` to support this crate. Until then I cannot publish this to
[`color-backtrace`] to support this crate. Until then I cannot publish this to
crates.io, the documentation is filled out however so simply run `cargo doc
--open` for an explanation of usage.

Expand Down Expand Up @@ -42,3 +42,7 @@ fn example(&self) -> color_eyre::Result<()> {
## Full Report Format (with `RUST_LIB_BACKTRACE=full`)

![full report format](./pictures/full.png)

[`eyre`]: https://docs.rs/eyre
[`tracing-error`]: https://docs.rs/tracing-error
[`color-backtrace`]: https://docs.rs/color-backtrace
33 changes: 32 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//! - captures a [`backtrace::Backtrace`] and prints using [`color-backtrace`]
//! - captures a [`tracing_error::SpanTrace`] and prints using
//! [`color-spantrace`]
//! - Only capture SpanTrace by default for better performance.
//! - display source lines when `RUST_LIB_BACKTRACE=full` is set from both of
//! the above libraries
//! - store help text via [`Help`] trait and display after final report
Expand Down Expand Up @@ -49,6 +50,31 @@
//! .suggestion("try using a file that exists next time")
//! }
//! ```
//!
//! # Report Formats
//!
//! The following report formats are available via setting the `RUST_LIB_BACKTRACE` variable.
//!
//! ## Minimal Report Format
//!
//! ![minimal report format](https://github.com/yaahc/color-eyre/blob/master/pictures/minimal.png)
//!
//! ## Short Report Format (with `RUST_LIB_BACKTRACE=1`)
//!
//! ![short report format](https://github.com/yaahc/color-eyre/blob/master/pictures/short.png)
//!
//! ## Full Report Format (with `RUST_LIB_BACKTRACE=full`)
//!
//! ![full report format](https://github.com/yaahc/color-eyre/blob/master/pictures/full.png)
//!
//! [`eyre::EyreContext`]: https://docs.rs/eyre/0.3.8/eyre/trait.EyreContext.html
//! [`backtrace::Backtrace`]: https://docs.rs/backtrace/0.3.46/backtrace/struct.Backtrace.html
//! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/0.1.2/tracing_error/struct.SpanTrace.html
//! [`color-backtrace`]: https://docs.rs/color-backtrace
//! [`color-spantrace`]: https://github.com/yaahc/color-spantrace
//! [`Help`]: trait.Help.html
//! [`eyre::Report`]: https://docs.rs/eyre/0.3.8/eyre/struct.Report.html
//! [`tracing-error`]: https://docs.rs/tracing-error
use backtrace::Backtrace;
use console::style;
use eyre::*;
Expand All @@ -62,10 +88,15 @@ use tracing_error::{ExtractSpanTrace, SpanTrace, SpanTraceStatus};
mod help;

/// A Custom Context type for [`eyre::Report`] which provides colorful error
/// reports and [`tracing_error`] support.
/// reports and [`tracing-error`] support.
///
/// This type is not intended to be used directly, prefer using it via the
/// [`color_eyre::Report`] and [`color_eyre::Result`] type aliases.
///
/// [`eyre::Report`]: https://docs.rs/eyre/0.3.8/eyre/struct.Report.html
/// [`tracing-error`]: https://docs.rs/tracing-error
/// [`color_eyre::Report`]: type.Report.html
/// [`color_eyre::Result`]: type.Result.html
pub struct Context {
backtrace: Option<Backtrace>,
span_trace: Option<SpanTrace>,
Expand Down

0 comments on commit 4e85352

Please sign in to comment.