You could use GitHub - dfinity/idl2json to convert candid to json and then use jq
.
As for the pretty printing, we stopped pretty printer when the data is too large, due to several reasons:
- it’s hard to know a good format for large data. For example,
vec { 1;2;3 }
.vs.vec {\n 1;\n2;\n3;\n }
; - The pretty printer we used is unfortunately not linear time, so for large data, it’s not very efficient;
- Even with the same type, we may need different format for different cases. For example, both
account_id
andasset_content
can be of typeblob
, but we may prefer to displayaccount_id
in hex, andasset_content
as printable ascii. Ideally, we need a way to specify how to pretty print each field.