2020-04-22 18:30:06 +02:00
|
|
|
//! `bat` is a library to print syntax highlighted content.
|
|
|
|
//!
|
2020-04-22 20:33:19 +02:00
|
|
|
//! The main struct of this crate is `PrettyPrinter` which can be used to
|
|
|
|
//! configure and run the syntax highlighting.
|
|
|
|
//!
|
2020-04-22 19:23:45 +02: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 22:57:32 +02:00
|
|
|
//! internal modules is much more likely to change. Some or all of these
|
|
|
|
//! modules might be removed in the future.
|
2020-04-22 19:23:45 +02:00
|
|
|
//!
|
|
|
|
//! "Hello world" example:
|
2020-04-22 18:30:06 +02:00
|
|
|
//! ```
|
|
|
|
//! use bat::PrettyPrinter;
|
|
|
|
//!
|
|
|
|
//! PrettyPrinter::new()
|
|
|
|
//! .input_from_bytes(b"<span style=\"color: #ff00cc\">Hello world!</span>\n")
|
|
|
|
//! .language("html")
|
2020-04-22 21:20:48 +02:00
|
|
|
//! .print()
|
2020-04-22 21:45:47 +02:00
|
|
|
//! .unwrap();
|
2020-04-22 18:30:06 +02:00
|
|
|
//! ```
|
|
|
|
|
2021-10-03 16:50:29 +02:00
|
|
|
#![deny(unsafe_code)]
|
|
|
|
|
2020-12-27 22:51:24 +01:00
|
|
|
mod macros;
|
|
|
|
|
2020-04-22 18:10:26 +02:00
|
|
|
pub mod assets;
|
2021-09-15 07:59:33 +02:00
|
|
|
pub mod assets_metadata {
|
|
|
|
pub use super::assets::assets_metadata::*;
|
|
|
|
}
|
2020-03-21 19:40:13 +01:00
|
|
|
pub mod config;
|
2020-04-22 18:10:26 +02:00
|
|
|
pub mod controller;
|
2019-10-20 22:09:58 +02:00
|
|
|
mod decorations;
|
|
|
|
mod diff;
|
2020-04-22 21:45:47 +02:00
|
|
|
pub mod error;
|
2020-04-22 16:27:34 +02:00
|
|
|
pub mod input;
|
2019-12-23 09:54:18 +01:00
|
|
|
mod less;
|
2023-09-02 08:48:26 +02:00
|
|
|
#[cfg(feature = "lessopen")]
|
|
|
|
mod lessopen;
|
2020-04-22 19:15:33 +02:00
|
|
|
pub mod line_range;
|
2023-03-14 22:21:30 +01:00
|
|
|
pub(crate) mod nonprintable_notation;
|
2019-10-29 19:46:04 +01:00
|
|
|
mod output;
|
2020-04-22 22:54:33 +02:00
|
|
|
#[cfg(feature = "paging")]
|
2020-11-26 22:46:24 +01:00
|
|
|
mod pager;
|
|
|
|
#[cfg(feature = "paging")]
|
2020-04-22 22:55:49 +02:00
|
|
|
pub(crate) mod paging;
|
2019-10-20 22:09:58 +02:00
|
|
|
mod preprocessor;
|
2020-04-22 18:30:06 +02:00
|
|
|
mod pretty_printer;
|
2020-03-21 21:15:12 +01:00
|
|
|
pub(crate) mod printer;
|
2020-04-22 21:16:30 +02:00
|
|
|
pub mod style;
|
2020-03-21 21:03:57 +01:00
|
|
|
pub(crate) mod syntax_mapping;
|
2019-10-20 22:09:58 +02:00
|
|
|
mod terminal;
|
2022-09-09 20:21:22 +02:00
|
|
|
mod vscreen;
|
2020-04-22 20:34:40 +02:00
|
|
|
pub(crate) mod wrapping;
|
2020-03-21 21:15:12 +01:00
|
|
|
|
2023-03-14 22:21:30 +01:00
|
|
|
pub use nonprintable_notation::NonprintableNotation;
|
2022-09-03 12:33:38 +02:00
|
|
|
pub use pretty_printer::{Input, PrettyPrinter, Syntax};
|
2020-04-22 18:10:26 +02:00
|
|
|
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
|
2020-04-22 20:34:40 +02:00
|
|
|
pub use wrapping::WrappingMode;
|
2020-04-22 21:53:01 +02:00
|
|
|
|
|
|
|
#[cfg(feature = "paging")]
|
2020-04-22 22:54:33 +02:00
|
|
|
pub use paging::PagingMode;
|