Add a JSON theme
This commit is contained in:
parent
7858211361
commit
937c2a450c
2 changed files with 12 additions and 0 deletions
|
|
@ -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
8
colout_json.py
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue