5
<LINK REL=StyleSheet HREF="./style/style.css" TYPE="text/css">
7
<a href="intro.html"><--previous</a> |
8
<a href="./index.html">contents</a> |
9
<a href="templates.html">next--></a>
13
<h1>Getting Started</h1>
15
<p> This section gives a quick overview of Cubictemp, centered around a very
19
<h2> Hello walrus: A Basic Substitution Example </h2>
21
<p> The simplest function of a templating system is basic substitution - that
22
is, taking one piece of text, and inserting it into another. Consider the
25
<code class="template">
29
<p>This line is a complete Cubictemp template. It contains the single
32
<code class="template">
36
- which we can use to insert the word "walrus" at the appropriate spot like
39
<pre><div class="pythoncode"><font color="#C00000">import</font> <font color="#000000">cubictemp</font>
41
<font color="#000000">template</font> <font color="#0000C0">=</font> <font color="#004080">"Hello @!foo!@."</font>
42
<font color="#000000">temp</font> <font color="#0000C0">=</font> <font color="#000000">cubictemp</font><font color="#0000C0">.</font><font color="#000000">Temp</font><font color="#0000C0">(</font><font color="#000000">template</font><font color="#0000C0">,</font> <font color="#000000">foo</font><font color="#0000C0">=</font><font color="#004080">"walrus"</font><font color="#0000C0">)</font>
43
<font color="#C00000">print</font> <font color="#000000">temp</font><font color="#000000"></font></div></pre>
45
<p>When we run the snippet of code above, the following output is
52
<p>That's it - the example above is perhaps the simplest possible Cubictemp
60
<a href="intro.html"><--previous</a> |
61
<a href="./index.html">contents</a> |
62
<a href="templates.html">next--></a>
70
<center> Cubictemp v0.4 Manual </center>