Color output of keys and values like jqSee original GitHub issue
Awesome project! I’m dealing now with a lot of yml files to be processed in kubernetes…
Is there a way to parse and print the key values in color?
Maybe just the same colors as
jq or like in the vim editor?
- Created 6 years ago
- Comments:10 (1 by maintainers)
Top GitHub Comments
I think it’s still worth doing as part of yq itself, many people use
cat a.json | jq . to preview highlighted and prettified json, it is so tempting to use
cat b.yaml | yq -y . to achieve the same for yaml files.
It’s okay if pygments is not ideal, just redirect people to their repo in case someone wants to report an issue.
pip install pygments and pipe the output of yq to
pygmentize -l yaml to highlight in the terminal. Unfortunately the Pygments yaml highlighter is very drab and does not highlight much. https://bitbucket.org/birkenfeld/pygments-main/issues?q=yaml