-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to color the output #8
base: master
Are you sure you want to change the base?
Conversation
I like this feature, thanks for the pull request. But the code needs some more work.
the background of the String will "leak out" of a surrounding array. I am unsure if a
|
We could go a step further and define colors for every piece of output (like some kind of syntax tree data type), including different colors for each punctuation character (and whitespace too):
|
I like Regarding the "step further", yes I think that goes too far. :-) |
3af1048
to
45a65b1
Compare
Implementation
A function to convert a JSON
Value
to a list of color commands[SGR]
from theansi-terminal
package has been added to bothConfig
andPState
.defConfig
still has the same behavior of no color (usingnoColors
).encodePretty
still has the default behavior of no color (implemented asencodePretty' defConfig
)encodePretty' colorConfig
colors the output by inserting color codes which are interpreted by the terminal.Example
Output to terminal
Piped into Vim