Crate expedition

Crate expedition 

Source
Expand description

A simple and universal rich text styling library, designed to be easily adapted to any output format.

Inspired by KyoriPowered/adventure.

In many cases when user messages are involved (such as in games or user-editable text fields), you may wish to add some rich text styling options such as color, or decorations such as bold or italic. Although many libraries such as termcolor or egui already support styling text with various options, they all use their own formats for doing so. This crate aims to provide a universal format for transmitting and storing rich text messages, supporting a subset of common features that other libraries contain.

§Usage

The entry point of the library is Message:

use expedition::{Message, IntoMessage};

let msg = Message::new("Hello, ")
    .with(Message::new("world!"));

See the documentation of Message for usage info.

§Feature flags

Re-exports§

pub use text::IntoMessage;
pub use text::Message;
pub use text::MessageStyle;
pub use text::Styleable;
pub use util::MessageFlattener;
pub use util::StackFlattener;

Modules§

egui
Features for converting objects to an egui format.
termcolor
Features for writing out text messages as text using ANSI color codes, using termcolor.
text
The core objects used by the library.
util
Utilities for manipulating text and text hierarchies.

Structs§

Color32
This format is used for space-efficient color representation (32 bits).