2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-16 21:25:56 +00:00
bat/src/lib.rs

49 lines
1.2 KiB
Rust
Raw Normal View History

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
//! ```
pub mod assets;
pub mod assets_metadata;
2020-03-21 18:40:13 +00:00
pub mod config;
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;
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;
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
pub use pretty_printer::PrettyPrinter;
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;