Skip to content

Commit

Permalink
add crate-level docs for syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
erratic-pattern committed Nov 11, 2023
1 parent eaade17 commit 882ec3d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
//! - [... delayed source code](#-delayed-source-code)
//! - [... handler options](#-handler-options)
//! - [... dynamic diagnostics](#-dynamic-diagnostics)
//! - [... syntax highlighting](#-syntax-highlighting)
//! - [Acknowledgements](#acknowledgements)
//! - [License](#license)
//!
Expand Down Expand Up @@ -625,6 +626,23 @@
//! println!("{:?}", report)
//! ```
//!
//! ### ... syntax highlighting
//!
//! When rendering in graphical mode, `miette` can be configured to highlight
//! source code snippets like this:
//!
//! <!-- TODO: screenshot goes here once default Theme is decided -->
//!
//! To use the built-in highlighting functionality, you must enable the
//! `syntect-highlighter` crate feature. When activated, `miette` will
//! automatically use the [`syntect`] crate to highlight the `#[source_code]`
//! field of your [`Diagnostic`].
//!
//! If you want to use your own custom highlighter, you can use the
//! [`MietteHandlerOpts::with_syntax_highlighting`] method to provide a
//! custom implementation of the [`Highlighter`](highlighters::Highlighter)
//! trait. See the [`highlighters`] module docs for more details.
//!
//! ## Acknowledgements
//!
//! `miette` was not developed in a void. It owes enormous credit to various
Expand Down

0 comments on commit 882ec3d

Please sign in to comment.