Next: , Up: Web Status


7.7.1 Jinja Web Templates

Buildbot uses Jinja2 to render its web interface. The authoritative source for this templating engine is its own documentation, of course, but a few notes are in order for those who are making only minor modifications.

Whitespace

Jinja directives are enclosed in {% .. %}, and sometimes also have dashes. These dashes strip whitespace in the output. For example:

     {% for entry in entries %}
       <li>{{ entry }}</li>
     {% endfor %}

will produce output with too much whitespace:

     
       <li>pigs</li>
     
     
       <li>cows</li>
     

But adding the dashes will collapse that whitespace completely:

     {% for entry in entries -%}
       <li>{{ entry }}</li>
     {%- endfor %}

yields

     <li>pigs</li><li>cows</li>