expedition/
lib.rs

1#![warn(missing_docs)]
2#![warn(clippy::all)]
3#![warn(clippy::nursery)]
4#![warn(clippy::cargo)]
5
6//! A simple and universal rich text styling library, designed to be easily adapted to any output
7//! format.
8//!
9//! Inspired by [KyoriPowered/adventure](https://github.com/KyoriPowered/adventure).
10//!
11//! In many cases when user messages are involved (such as in games or user-editable text fields),
12//! you may wish to add some rich text styling options such as color, or decorations such as bold
13//! or italic. Although many libraries such as termcolor or egui already support styling text
14//! with various options, they all use their own formats for doing so. This crate aims to provide
15//! a universal format for transmitting and storing rich text messages, supporting a subset of
16//! common features that other libraries contain.
17//!
18//! # Usage
19//!
20//! The entry point of the library is [`Message`]:
21//!
22//! ```
23//! use expedition::{Message, IntoMessage};
24//!
25//! let msg = Message::new("Hello, ")
26//!     .with(Message::new("world!"));
27//! ```
28//!
29//! See the documentation of [`Message`] for usage info.
30//!
31//! ## Feature flags
32#![cfg_attr(feature = "document_features", doc = document_features::document_features!())]
33//!
34//! [`Message`]: crate::Message
35
36#[cfg(feature = "egui")]
37pub mod egui;
38#[cfg(feature = "termcolor")]
39pub mod termcolor;
40pub mod text;
41pub mod util;
42
43pub use ecolor::Color32;
44pub use text::{IntoMessage, Message, MessageStyle, Styleable};
45pub use util::{MessageFlattener, StackFlattener};