+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Documentation | Jinja Template Engine</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="./static/style.css" type="text/css" />
- <link rel="stylesheet" href="./static/print.css" type="text/css" media="print" />
- <link rel="stylesheet" href="./static/pygments.css" type="text/css" />
- </head>
- <body>
- <div id="header">
- <h1>Jinja</h1>
- </div>
- <ul id="navigation">
- <li><a href="./index.html">Index</a></li>
- <li><a href="./faq.html">FAQ</a></li>
- <li class="active"><a href="./documentation.html">Documentation</a></li>
- <li><a href="./download.html">Download</a></li>
- </ul>
- <div id="content">
- <div id="contentwrapper">
- <h1>Documentation</h1>
- <p>
- Currently Jinja 1 in still under heavy development and we have neither
- released a final version nor do we provide a documentation you can download.
- However you can browse the documentation of the current SVN version online:
- </p>
- <p><a href="./documentation/index.html">browse online documentation</a></p>
- </div>
- </div>
- <div id="footer">
- © Copyright 2007 by the Pocoo Team.
- </div>
- </body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Download | Jinja Template Engine</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="./static/style.css" type="text/css" />
- <link rel="stylesheet" href="./static/print.css" type="text/css" media="print" />
- <link rel="stylesheet" href="./static/pygments.css" type="text/css" />
- </head>
- <body>
- <div id="header">
- <h1>Jinja</h1>
- </div>
- <ul id="navigation">
- <li><a href="./index.html">Index</a></li>
- <li><a href="./faq.html">FAQ</a></li>
- <li><a href="./documentation.html">Documentation</a></li>
- <li class="active"><a href="./download.html">Download</a></li>
- </ul>
- <div id="content">
- <div id="contentwrapper">
- <h1>Download</h1>
- <p>
- If you want to install the release with
- <a href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a>,
- you can do it using this command:
- </p>
- <pre>easy_install Jinja</pre>
- <p>
- You can also get the development source from subversion using this command:
- </p>
- <pre>svn co http://trac.pocoo.org/repos/jinja/trunk jinja</pre>
- <p>
- Installing the current subversion trunk as a Python egg is done with:
- </p>
- <pre>easy_install Jinja==dev</pre>
- <p>
- Development takes place at the <a href="http://trac.pocoo.org/">Pocoo trac</a>,
- you can browse the source online
- <a href="http://trac.pocoo.org/browser/jinja/trunk">here</a>.
- </p>
- </div>
- </div>
- <div id="footer">
- © Copyright 2007 by the Pocoo Team.
- </div>
- </body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>FAQ | Jinja Template Engine</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="./static/style.css" type="text/css" />
- <link rel="stylesheet" href="./static/print.css" type="text/css" media="print" />
- <link rel="stylesheet" href="./static/pygments.css" type="text/css" />
- </head>
- <body>
- <div id="header">
- <h1>Jinja</h1>
- </div>
- <ul id="navigation">
- <li><a href="./index.html">Index</a></li>
- <li class="active"><a href="./faq.html">FAQ</a></li>
- <li><a href="./documentation.html">Documentation</a></li>
- <li><a href="./download.html">Download</a></li>
- </ul>
- <div id="content">
- <div id="contentwrapper">
- <h1>Frequently Asked Questions</h1>
- <p>
- Here a list of frequently asked questions.
- </p>
- <h2>Why the Name?</h2>
- <p>
- The name Jinja was chosen because it's the name of a Japanese temple and
- temple and template share a similar pronunciation.
- </p>
- <h2>How fast is it?</h2>
- <p>
- I really hate benchmarks especially since they don't reflect much. The
- performance of a template depends on many factors and you would have to
- benchmark different engines in differen situations. However Jinja isn't
- slow. The benchmarks from the testsuite show that Jinja is about twice
- as fast as Django templates and about three times as slow as
- <a href="http://www.makotemplates.org/">mako</a>. That's not bad for a
- sandboxed template engine that has to sanitize template input on the fly.
- If you really need the best performance of a template engine consider
- using mako.
- </p>
- <h2>What happened to Jinja < 1?</h2>
- <p>
- Before Jinja 1 there was a template engine too with the same name. Beside
- the name and the same maintainer those two projects don't share a single
- line of code. If you have an application using Jinja < 1 you should try
- to make it Jinja 1 compatible. If that's not possible, the old project is
- still available as
- <a href="http://trac.pocoo.org/repos/jinja/branches/0.9-maint/">0.9-maint</a>
- in the Jinja subversion repository.
- </p>
- <h2>Why should I use Jinja?</h2>
- <p>
- There are dozens of template engines for Python, many of them try to
- achieve different things. If you are looking for a XML based template
- engine have a look at <a href="http://genshi.edgewall.org/">genshi</a>,
- if you want a bleezing fast template engine with the full range of
- python constructs have a look at mako. If you want sandboxed templates
- you probably want to check out Jinja.
- </p>
- </div>
- </div>
- <div id="footer">
- © Copyright 2007 by the Pocoo Team.
- </div>
- </body>
-</html>
\ No newline at end of file
+++ /dev/null
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Index | Jinja Template Engine</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="./static/style.css" type="text/css" />
- <link rel="stylesheet" href="./static/print.css" type="text/css" media="print" />
- <link rel="stylesheet" href="./static/pygments.css" type="text/css" />
- </head>
- <body>
- <div id="header">
- <h1>Jinja</h1>
- </div>
- <ul id="navigation">
- <li class="active"><a href="./index.html">Index</a></li>
- <li><a href="./faq.html">FAQ</a></li>
- <li><a href="./documentation.html">Documentation</a></li>
- <li><a href="./download.html">Download</a></li>
- </ul>
- <div id="content">
- <div id="contentwrapper">
- <h1>Jinja Templates</h1>
- <p>
- Jinja is a
- <a href="http://en.wikipedia.org/wiki/Sandbox_%28computer_security%29">sandboxed</a>
- template engine written in pure <a href="http://www.python.org/">Python</a>. It
- provides a <a href="http://www.djangoproject.com/">Django</a>-like non-XML syntax
- and compiles templates into executable python code. It's basically a combination
- of Django templates and python code.
- </p>
- <h2>Nutshell</h2>
- <div class="syntax"><pre><span class="cp">{%</span> <span class="k">extends</span> <span class="s1">'base.html'</span> <span class="cp">%}</span>
-<span class="cp">{%</span> <span class="k">block</span> <span class="nv">title</span> <span class="cp">%}</span>Memberlist<span class="cp">{%</span> <span class="k">endblock</span> <span class="cp">%}</span>
-<span class="cp">{%</span> <span class="k">block</span> <span class="nv">content</span> <span class="cp">%}</span>
- <span class="nt"><ul></span>
- <span class="cp">{%</span> <span class="k">for</span> <span class="nv">user</span> <span class="k">in</span> <span class="nv">users</span> <span class="cp">%}</span>
- <span class="nt"><li><a</span> <span class="na">href=</span><span class="s">"</span><span class="cp">{{</span> <span class="nv">user.url</span><span class="o">|</span><span class="nf">e</span> <span class="cp">}}</span><span class="s">"</span><span class="nt">></span><span class="cp">{{</span> <span class="nv">user.username</span><span class="o">|</span><span class="nf">e</span> <span class="cp">}}</span><span class="nt"></a></li></span>
- <span class="cp">{%</span> <span class="k">endfor</span> <span class="cp">%}</span>
- <span class="nt"></ul></span>
-<span class="cp">{%</span> <span class="k">endblock</span> <span class="cp">%}</span>
-</pre></div>
- <h2>Philosophy</h2>
- <p>
- Application logic is for the controller but don't try to make the life for the
- template designer too hard by giving him too few functionality.
- </p>
- <h2>Features</h2>
- <ul>
- <li><strong>Simple API</strong>. For basic usage just one function is needed:
-<div class="syntax"><pre><span class="k">from</span> <span class="nn">jinja</span> <span class="k">import</span> <span class="n">from_string</span>
-<span class="k">print</span> <span class="n">from_string</span><span class="p">(</span><span class="s">'Hello {{ data }}!'</span><span class="p">)</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="s">'World'</span><span class="p">)</span>
-</pre></div>
-</li>
- <li><strong>Sandboxed</strong>. The whole engine is completely sandboxed. A
- template designer won't be able to modify application data or execute
- dangerous code.</li>
- <li><strong>Python expressions</strong>. You can use nearly every python
- expression. Not supported are the binary operators and list comprehensions /
- generator expressions.</li>
- <li><strong>Inheritance</strong>. Jinja uses the same concept for inheritance
- Django uses. It's very powerful and easy to understand.</li>
- <li><strong>Macros</strong>. Jinja provides so called macros that allow you to
- put often used template snippets into callable blocks:
-<div class="syntax"><pre><span class="cp">{%</span> <span class="k">macro</span> <span class="nv">dialog</span> <span class="nv">title</span><span class="o">,</span> <span class="nv">text</span> <span class="cp">%}</span>
- <span class="nt"><div</span> <span class="na">class=</span><span class="s">"dialog"</span><span class="nt">></span>
- <span class="nt"><h2</span> <span class="na">class=</span><span class="s">"title"</span><span class="nt">></span><span class="cp">{{</span> <span class="nv">title</span> <span class="cp">}}</span><span class="nt"></h2></span>
- <span class="nt"><div</span> <span class="na">class=</span><span class="s">"text"</span><span class="nt">></span><span class="cp">{{</span> <span class="nv">text</span> <span class="cp">}}</span><span class="nt"></div></span>
- <span class="nt"></div></span>
-<span class="cp">{%</span> <span class="k">endmacro</span> <span class="cp">%}</span>
-</pre></div>
-You can then use this block by calling it:
-<div class="syntax"><pre><span class="cp">{{</span> <span class="nv">dialog</span><span class="o">(</span><span class="s1">'Notification'</span><span class="o">,</span> <span class="s1">'Here the text for the macro.'</span><span class="o">)</span> <span class="cp">}}</span>
-</pre></div>
-</li>
- <li><strong>Designer friendly</strong>. Jinja simplifies many things for a
- template designer. Loops can be used in a recursive way, filters are
- available to format values, loops know about their iteration etc.</li>
- <li><strong>Dynamic Syntax</strong>. You don't like the Django block syntax?
- You can override the syntax elements on environment initialisation. It's
- no problem to use ASP/PHP/Ruby syntax, html comments for blocks etc.</li>
- </ul>
- </div>
- </div>
- <div id="footer">
- © Copyright 2007 by the Pocoo Team.
- </div>
- </body>
-</html>
\ No newline at end of file