Damn. You just made me realize that as a crate author we can have ASCII art in the Debug impl, and that as a stdlib we could have a trait to standardize that behaviour.
Conversation
I think that repurposing # for this is smart, also think that it'd be interesting if it could be term aware for colouring and the like. 🤔
1
6
Maybe we should have a cli!() macro?
The thing that would be interesting is having an HTML style datatype for output and delay the formatting to right before it gets printed.
1
6
Not entirely the same, but OCaml has a `Format` module for pretty printing. I find it a bit janky tbh but it's cool that at least there is some standardisation: v2.ocaml.org/api/Format.html - you can add tags for additional formatting info: v2.ocaml.org/api/Format.htm.
1
2
The pretty crate supplies a similar ‘whatever you want’ style of annotation support as well: github.com/Marwes/pretty. - which allows you to add on colours if you want it at some level - integration with the fmt is difficult though (term width is also an issue).
Finding the right level of abstraction for the separation might be tricky… eg. it would also be neat if at some level you could present stuff in an accessible, non-ascii-art way, and in the process also support non-ascii consumers.
2
This is what we're using on Flux, though it's not surprising since Markus is on the team ;)
1
2
Oh cool! :)
1



