Add a JSON theme

This commit is contained in:
Johann Dreo 2013-03-23 00:23:50 +01:00
commit 937c2a450c
2 changed files with 12 additions and 0 deletions

View file

@ -120,3 +120,7 @@ special characters that would be recognize by your shell.
* Color a source code in 256 colors mode:
`cat colout.py | colout Python monokai`
* Color a JSON stream:
`echo '{"foo": "lorem", "bar":"ipsum"}' | python -mjson.tool | colout -t json`

8
colout_json.py Normal file
View file

@ -0,0 +1,8 @@
import colout
def theme( item ):
item = colout.colorup( item, '[{}]' )
item = colout.colorup( item, '[:,]', "blue" )
item = colout.colorup( item, '".*"', "green" )
return item