rotulus-mirc 0.1.0

Parse IRC (mIRC) formatting codes into Rotulus styled text
Documentation
  • Coverage
  • 88.89%
    8 out of 9 items documented0 out of 5 items with examples
  • Size
  • Source code size: 41.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 237.1 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1s Average build duration of successful builds.
  • all releases: 1s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mishan/rotulus
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mishan

rotulus-mirc

IRC formatting codes, as Rotulus styled text.

IRC carries its styling in-band: a byte like 0x02 toggles bold, and 0x03 followed by digits sets a color. Rotulus never interprets bytes like these itself, because a view that did would let anyone who can send it text restyle its transcript. So an IRC client decides which messages may carry formatting, and converts those here, into ordinary styled runs, before appending them.

let text = rotulus_mirc::parse("\x02bold\x02 and \x034red");
assert_eq!(text.text, "bold and red");

assert_eq!(rotulus_mirc::strip("\x02plain\x02"), "plain");

The vocabulary is the one documented at https://modern.ircdocs.horse/formatting: bold, italic, underline, strikethrough, monospace, reverse, reset, and colors by number or by hex. Nothing here fails: an incomplete code is dropped, and anything that isn't a code is text.

License: LGPL-2.1-or-later.