Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 9457b02689c69e152aa2cda68176fa51 > files > 103

buildbot-doc-0.8.4p1-2.fc16.noarch.rpm

<html lang="en">
<head>
<title>Jinja Web Templates - BuildBot Manual - 0.8.4p1</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="BuildBot Manual - 0.8.4p1">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Web-Status.html#Web-Status" title="Web Status">
<link rel="next" href="Web-Authorization-Framework.html#Web-Authorization-Framework" title="Web Authorization Framework">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
This is the BuildBot manual for Buildbot version 0.8.4p1.

Copyright (C) 2005, 2006, 2009, 2010 Brian Warner

Copying and distribution of this file, with or without
modification, are permitted in any medium without royalty
provided the copyright notice and this notice are preserved.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Jinja-Web-Templates"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Web-Authorization-Framework.html#Web-Authorization-Framework">Web Authorization Framework</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Web-Status.html#Web-Status">Web Status</a>
<hr>
</div>

<h4 class="subsection">8.6.1 Jinja Web Templates</h4>

<p>Buildbot uses Jinja2 to render its web interface.  The authoritative source for
this templating engine is <a href="http://jinja.pocoo.org/2/documentation/">its own documentation</a>, of course, but a few notes are in order for those who are
making only minor modifications.

<h3 class="heading">Whitespace</h3>

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

<pre class="example">     {% for entry in entries %}
       &lt;li&gt;{{ entry }}&lt;/li&gt;
     {% endfor %}
</pre>
   <p>will produce output with too much whitespace:

<pre class="example">     
       &lt;li&gt;pigs&lt;/li&gt;
     
     
       &lt;li&gt;cows&lt;/li&gt;
     
</pre>
   <p>But adding the dashes will collapse that whitespace completely:

<pre class="example">     {% for entry in entries -%}
       &lt;li&gt;{{ entry }}&lt;/li&gt;
     {%- endfor %}
</pre>
   <p>yields

<pre class="example">     &lt;li&gt;pigs&lt;/li&gt;&lt;li&gt;cows&lt;/li&gt;
</pre>
   </body></html>