encode

Serializes template to a pretty-printed JSON string.