Improved pretty-printing of template directives.