on v0.15.0 help sign in
bat/src/lib.rs
48 lines 1.3 kB history raw
1//! `bat` is a library to print syntax highlighted content.
2//!
3//! The main struct of this crate is `PrettyPrinter` which can be used to
4//! configure and run the syntax highlighting.
5//!
6//! If you need more control, you can also use the structs in the submodules
7//! (start with `controller::Controller`), but note that the API of these
8//! internal modules is much more likely to change. Some or all of these
9//! modules might be removed in the future.
10//!
11//! "Hello world" example:
12//! ```
13//! use bat::PrettyPrinter;
14//!
15//! PrettyPrinter::new()
16//! .input_from_bytes(b"<span style=\"color: #ff00cc\">Hello world!</span>\n")
17//! .language("html")
18//! .print()
19//! .unwrap();
20//! ```
22pub mod assets;
23pub mod assets_metadata;
24pub mod config;
25pub mod controller;
26mod decorations;
27mod diff;
28pub mod error;
29pub mod input;
30mod less;
31pub mod line_range;
32mod output;
33#[cfg(feature = "paging")]
34pub(crate) mod paging;
35mod preprocessor;
36mod pretty_printer;
37pub(crate) mod printer;
38pub mod style;
39pub(crate) mod syntax_mapping;
40mod terminal;
41pub(crate) mod wrapping;
43pub use pretty_printer::PrettyPrinter;
44pub use syntax_mapping::{MappingTarget, SyntaxMapping};
45pub use wrapping::WrappingMode;
47#[cfg(feature = "paging")]
48pub use paging::PagingMode;