Jinja2 is a templating language and parsing module built by Armin Ronacher of Flask, Click and Werkzeug fame (among many other accomplishments). Jinja2 is used in a variety of projects, including Flask itself, Ansible and Pelican (a Python static website generator). I've grown quite accustomed to the Jinja2 syntax, and I really love the project.
Jinja2 itself has some interesting syntax for handling whitespace. According to its documentation, a template can control whitespace around template control flow blocks by the placement of a -
adjacent to block delimiters. For example,