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

Modules

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

Structs

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