<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;A template is used to build one ore more pages for a web application.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://github.com/gmurray/protorabbit/raw/master/docs/images/protorabbit-template.png&quot;/&gt;&lt;/p&gt;
&lt;p&gt;In protorabbit a template  is described using JavaScript Object Notation (&lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt;). A basic template looks like the following:&lt;/p&gt;
&lt;pre&gt;
{  &quot;templates&quot; : [
     {
      &quot;id&quot; : &quot;blueprints-css&quot;,
      &quot;template&quot; : &quot;templates/bp-2-column-base.html&quot;,   
      &quot;styles&quot; : {
        &quot;libs&quot; : [
           { &quot;id&quot; : &quot;blueprint&quot;, &quot;url&quot; : &quot;lib/grid.css&quot;}
         ]
      },
      &quot;properties&quot; : {
          &quot;title&quot; :  { &quot;type&quot; : &quot;string&quot;, &quot;value&quot; : &quot;Welcome to Proto Rabbit&quot;},
          &quot;header&quot; : { &quot;type&quot; : &quot;include&quot;, &quot;value&quot; : &quot;/header.html&quot; },
          &quot;body&quot; : {  &quot;type&quot; : &quot;include&quot;, &quot;value&quot; : &quot;/blueprints.html&quot;},
          &quot;sidebar&quot; : { &quot;type&quot; : &quot;include&quot;, &quot;value&quot; : &quot;/sidebar.html&quot; },
          &quot;footer&quot; : { &quot;type&quot; : &quot;include&quot;, &quot;value&quot; : &quot;/footer.html&quot; } 
      }
    }
  ]
}
&lt;/pre&gt;
&lt;p&gt;The template above describes the component parts of a page such as the text for the title, and &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; fragments defined in files. The layout of the properties described in a template are provided in a &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; file with tokens that represent commands to the egine protorabbit engine. The &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; template is specified using the &amp;#8220;template&amp;#8221; property with the path to the &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; template.&lt;/p&gt;
&lt;p&gt;Following is a template describing the layout for all templates that based on the &amp;#8220;blueprints-base&amp;#8221; template. All descendant templates will use this layout unless they override it.&lt;/p&gt;
&lt;pre&gt;
&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot;
   &quot;http://www.w3.org/TR/html4/strict.dtd&quot;&amp;gt;

&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
 &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&amp;gt;
 &amp;lt;title&amp;gt;&amp;lt;^ insert('title') ^&amp;gt;&amp;lt;/title&amp;gt;
  &amp;lt;^ includeResources('styles') ^&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;div class=&quot;container&quot;&amp;gt; 

 &amp;lt;div class=&quot;block&quot;&amp;gt;
  &amp;lt;div class=&quot;column span-24&quot;&amp;gt;
   &amp;lt;div&amp;gt;
    &amp;lt;div style=&quot;font-size:2em&quot;&amp;gt;&amp;lt;^ insert('title') ^&amp;gt;&amp;lt;/div&amp;gt;
   &amp;lt;/div&amp;gt;
    &amp;lt;^ include('header') ^&amp;gt;
   &amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;

&amp;lt;div class=&quot;block&quot;&amp;gt;
 &amp;lt;div class=&quot;column span-18 colborder&quot;&amp;gt;
  &amp;lt;div&amp;gt;
   &amp;lt;^ include('body') ^&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div class=&quot;column span-5 last&quot;&amp;gt;
   &amp;lt;^ include('sidebar') ^&amp;gt;
  &amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;

&amp;lt;/div&amp;gt;
 &amp;lt;^ includeResources('scripts') ^&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;p&gt;You may notice the tokens delimited by the &amp;lt;^ commandName(&amp;#8230;) ^&amp;gt; in the template. These are tokens that specific what to do in a specific region of the page. Protorabbit out of the box provides commands for replacing tokens with files (include) or replacing tokens (insert) with text or including script or css links resources in a page (includResources).&lt;/p&gt;</body>
  <created-at type="datetime">2009-11-26T15:43:54-08:00</created-at>
  <id type="integer">206198</id>
  <permalink>templates</permalink>
  <repository-id type="integer">160673</repository-id>
  <title>Templates</title>
  <updated-at type="datetime">2009-06-03T14:43:25-07:00</updated-at>
  <user-id type="integer">31047</user-id>
</wiki>
