11 releases (breaking)

new 0.9.1 Apr 19, 2024
0.9.0 Dec 5, 2023
0.8.0 Sep 15, 2023
0.7.0 May 17, 2023
0.4.0 Nov 19, 2022

#954 in Parser implementations

Download history 7/week @ 2023-12-22 2/week @ 2023-12-29 3/week @ 2024-02-09 30/week @ 2024-02-16 31/week @ 2024-02-23 16/week @ 2024-03-01 21/week @ 2024-03-08 24/week @ 2024-03-15 24/week @ 2024-03-22 41/week @ 2024-03-29 20/week @ 2024-04-05

111 downloads per month
Used in 6 crates (5 directly)

MIT license

270KB
4.5K SLoC

Azalea Chat

Things for working with Minecraft formatted text components.

Examples

// convert a Minecraft formatted text JSON into colored text that can be printed to the terminal.

use azalea_chat::FormattedText;
use serde_json::Value;
use serde::Deserialize;

let j: Value = serde_json::from_str(
    r#"{"text": "hello","color": "red","bold": true}"#
)
.unwrap();
let text = FormattedText::deserialize(&j).unwrap();
assert_eq!(
    text.to_ansi(),
    "\u{1b}[1m\u{1b}[38;2;255;85;85mhello\u{1b}[m"
);

Dependencies

~1–2MB
~42K SLoC