2020-04-22 16:30:06 +00:00
|
|
|
//! `bat` is a library to print syntax highlighted content.
|
|
|
|
//!
|
2020-04-22 18:33:19 +00:00
|
|
|
//! The main struct of this crate is `PrettyPrinter` which can be used to
|
|
|
|
//! configure and run the syntax highlighting.
|
|
|
|
//!
|
2020-04-22 17:23:45 +00:00
|
|
|
//! If you need more control, you can also use the structs in the submodules
|
|
|
|
//! (start with `controller::Controller`), but note that the API of these
|
2020-04-22 20:57:32 +00:00
|
|
|
//! internal modules is much more likely to change. Some or all of these
|
|
|
|
//! modules might be removed in the future.
|
2020-04-22 17:23:45 +00:00
|
|
|
//!
|
|
|
|
//! "Hello world" example:
|
2020-04-22 16:30:06 +00:00
|
|
|
//! ```
|
|
|
|
//! use bat::PrettyPrinter;
|
|
|
|
//!
|
|
|
|
//! PrettyPrinter::new()
|
|
|
|
//! .input_from_bytes(b"<span style=\"color: #ff00cc\">Hello world!</span>\n")
|
|
|
|
//! .language("html")
|
2020-04-22 19:20:48 +00:00
|
|
|
//! .print()
|
2020-04-22 19:45:47 +00:00
|
|
|
//! .unwrap();
|
2020-04-22 16:30:06 +00:00
|
|
|
//! ```
|
|
|
|
|
2020-04-22 16:10:26 +00:00
|
|
|
pub mod assets;
|
|
|
|
pub mod assets_metadata;
|
2020-03-21 18:40:13 +00:00
|
|
|
pub mod config;
|
2020-04-22 16:10:26 +00:00
|
|
|
pub mod controller;
|
2019-10-20 20:09:58 +00:00
|
|
|
mod decorations;
|
|
|
|
mod diff;
|
2020-04-22 19:45:47 +00:00
|
|
|
pub mod error;
|
2020-04-22 14:27:34 +00:00
|
|
|
pub mod input;
|
2019-12-23 08:54:18 +00:00
|
|
|
mod less;
|
2020-04-22 17:15:33 +00:00
|
|
|
pub mod line_range;
|
2019-10-29 18:46:04 +00:00
|
|
|
mod output;
|
2020-04-22 20:54:33 +00:00
|
|
|
#[cfg(feature = "paging")]
|
2020-04-22 20:55:49 +00:00
|
|
|
pub(crate) mod paging;
|
2019-10-20 20:09:58 +00:00
|
|
|
mod preprocessor;
|
2020-04-22 16:30:06 +00:00
|
|
|
mod pretty_printer;
|
2020-03-21 20:15:12 +00:00
|
|
|
pub(crate) mod printer;
|
2020-04-22 19:16:30 +00:00
|
|
|
pub mod style;
|
2020-03-21 20:03:57 +00:00
|
|
|
pub(crate) mod syntax_mapping;
|
2019-10-20 20:09:58 +00:00
|
|
|
mod terminal;
|
2020-04-22 18:34:40 +00:00
|
|
|
pub(crate) mod wrapping;
|
2020-03-21 20:15:12 +00:00
|
|
|
|
2020-04-21 17:08:19 +00:00
|
|
|
pub use pretty_printer::PrettyPrinter;
|
2020-04-22 16:10:26 +00:00
|
|
|
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
|
2020-04-22 18:34:40 +00:00
|
|
|
pub use wrapping::WrappingMode;
|
2020-04-22 19:53:01 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "paging")]
|
2020-04-22 20:54:33 +00:00
|
|
|
pub use paging::PagingMode;
|