bat/src/lib.rs

62 lines
1.5 KiB
Rust
Raw Normal View History

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
//! ```
#![deny(unsafe_code)]
mod macros;
pub mod assets;
pub mod assets_metadata {
pub use super::assets::assets_metadata::*;
}
2020-03-21 19:40:13 +01:00
pub mod config;
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;
mod less;
#[cfg(feature = "lessopen")]
mod lessopen;
2020-04-22 19:15:33 +02:00
pub mod line_range;
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")]
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;
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;
mod vscreen;
2020-04-22 20:34:40 +02:00
pub(crate) mod wrapping;
2020-03-21 21:15:12 +01:00
pub use nonprintable_notation::NonprintableNotation;
pub use pretty_printer::{Input, PrettyPrinter, Syntax};
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;