Live data from Hacker News

PJSON: pretty, colorful json output formatting for terminal

igorgue.com

1–10 of 36 posts

Re: PJSON: pretty, colorful json output formatting for terminal

#6
If this is based on pygments, is it reasonable to have a command like this that works on everything pygments knows how to highlight, and plugs into a bunch of pretty-printers / reformatters, e.g. GNU indent?

Is there an equivalent of pygments for pretty-printing all the things?

Re: PJSON: pretty, colorful json output formatting for terminal

#7
post #3

Wait wait ... what are the unicode characters for that cloud and lightning bolt? That looks awesome.

Author here, unfortunately no thunder on Mountain Lion :( [1]

It's from my zsh theme: https://raw.github.com/igorgue/oh-my-zsh/master/themes/igorg... I stole it from the cloud theme and another theme that I don't remember.

The thunder lights up when the program doesn't end property (return 0).

[1] http://wiki.xkcd.com/irc/Heart_Thunder

Re: PJSON: pretty, colorful json output formatting for terminal

#10
post #8

Here's a similar trick with the Python json module: echo '{"hello":"there"}' | python -mjson.tool

And Perl's JSON::XS echo '{"hello":"there"}' | json_xs

Or for pretty colors, try Data::Printer

    echo '{"hello":"there"}' | perl -MJSON -MDDP -E '$f = decode_json readline; p $f'
Post reply on HN