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