13 releases (breaking)

0.10.1 Apr 24, 2024
0.9.1 Apr 19, 2024
0.9.0 Dec 5, 2023
0.8.0 Sep 15, 2023
0.4.0 Nov 19, 2022

#929 in Parser implementations

Download history 5/week @ 2024-02-12 40/week @ 2024-02-19 29/week @ 2024-02-26 14/week @ 2024-03-04 23/week @ 2024-03-11 20/week @ 2024-03-18 28/week @ 2024-03-25 51/week @ 2024-04-01 6/week @ 2024-04-08 174/week @ 2024-04-15 398/week @ 2024-04-22 39/week @ 2024-04-29 10/week @ 2024-05-06

622 downloads per month
Used in 7 crates (6 directly)

MIT license

285KB
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–2.1MB
~44K SLoC