on v0.18.3 help sign in
bat/src/lib.rs
52 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//! ```
22mod macros;
24pub mod assets;
25pub mod assets_metadata;
26pub mod config;
27pub mod controller;
28mod decorations;
29mod diff;
30pub mod error;
31pub mod input;
32mod less;
33pub mod line_range;
34mod output;
35#[cfg(feature = "paging")]
36mod pager;
37#[cfg(feature = "paging")]
38pub(crate) mod paging;
39mod preprocessor;
40mod pretty_printer;
41pub(crate) mod printer;
42pub mod style;
43pub(crate) mod syntax_mapping;
44mod terminal;
45pub(crate) mod wrapping;
47pub use pretty_printer::{Input, PrettyPrinter};
48pub use syntax_mapping::{MappingTarget, SyntaxMapping};
49pub use wrapping::WrappingMode;
51#[cfg(feature = "paging")]
52pub use paging::PagingMode;