A formatting library for MoonBit
test {
assert_eq!(format("Hello {}!", ["World"]), "Hello World!")
assert_eq!(try_format!("Hello {}!", ["World"]), "Hello World!")
}test {
@base.print("{}", [fg(@style.Red).compose(emph(Bold)).compose("Bold red text")])
}test {
let doc = group(text("hello") + nest(break_with(" , ") + text("world")))
// Here we overload the `width` parameter to specify the pretty printing width.
assert_eq!(prettify("{:6}", [doc]), "hello\n world")
}A formatting library for MoonBit