jsonpp-rs
jsonpp-rs copied to clipboard
Add optional color support
Json syntax highlighting would be a great addition to the library. One possibility is highlighting by default when stdout is a tty and no highlighting when stdout is a pipe or file. A --color
flag could be used to override default behavior
good suggestion, I will think about it! I'd also be happy to accept a PR :smile:
I'd like to work on this if @JeffBelgum doesn't pick it up
@BrainMaestro sounds good! I suggest you add a color: bool
member to PrettyFormatter
and handle colors conditionally there. Feel free to open issues if you have any questions!
@BrainMaestro yeah go for it!
For people like me who want this but don't care nearly enough to try to implement it, I recommend piping into bat
. ./my-program | jsonpp | bat --language=json