[svn] update on webpage and docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
--HG-- branch : trunk
authored by Armin Ronacher · committed by Armin Ronacher · parent 8ff24c4 · Browse files · 2 files·+43 added−2 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+43 added−2 removed
- other:+43 added−2 removed
Provenance
- Commit
6ec1b7e- Tree
abe30df- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
8ff24c4
2 files changed+43 added−2 removed
modified:docs/src/loaders.txt+3 added-2 removed
80 unmodified lines81 def check_source_changed(self, environment, name):82 fn = join(self.path, name)83 if exists(fn):84 return getmtime(fn)85- return 085+ return -186 87 You don't have to provide the `check_source_changed` method. If it doesn't88 exist the option `auto_reload` won't have an effect. Also note that the89 `check_source_changed` method must not raise an exception if the template90-does not exist but return ``0``.90+does not exist but return ``-1``. The return value ``-1`` is considered91+"always reload" whereas ``0`` means "do not reload".modified:www/faq.tmpl+40 added
40 unmodified lines41 if you want a bleezing fast template engine with the full range of42 python constructs have a look at mako. If you want sandboxed templates43 you probably want to check out Jinja.44 </p>45+ <h2>Differences to Django</h2>46+ <p>47+ While the Jinja default syntax looks pretty much like Django the rest of48+ the template engine works completely different. Jinja was designed to be49+ used without Django and to support Python expressions.50+ </p>51+ <p>Features that Jinja has in common with Django</p>52+ <ul>53+ <li>filter functions</li>54+ <li>block based template inheritance</li>55+ <li>the <tt>{% cycle %}</tt> and <tt>{% filter %}</li> tag</li>56+ <li>being sandboxed</li>57+ <li>similar default syntax</li>58+ </ul>59+ <p>Differences to Django</p>60+ <ul>61+ <li>advanced lexer that allows escaping of tags</li>62+ <li>generation of bytecode for faster template execution</li>63+ <li>definition of macros (often recurring tasks like rendering64+ dialog boxes, form elements etc.)</li>65+ <li>raw blocks</li>66+ <li>uncoupled internationalization support</li>67+ <li>expression support in any tag</li>68+ <li>abbility of modifying the context from the template69+ by using the <tt>{% set %}</li> tag.</li>70+ <li>support for function calling with arguments</li>71+ <li>filters can be called with a variable argument count</li>72+ <li>full unicode support</li>73+ <li>deferred objects (objects that are resolved on first74+ access, not on context instanciation)</li>75+ <li>Missing support for <tt>{{ block.super }}</tt></li>76+ <li>Support for recursing by using recursing for loops77+ or self calling macros.</li>78+ <li>If blocks have support for multiple elif statements</li>79+ <li>for loops have an optional else block executed if80+ there was no iteration.</li>81+ <li>test functions like <tt>is even</tt> etc.</li>82+ <li>block delimiters are exchangeable.</il>83+ <li>no implicit function calling</li>84+ </ul>85 <% endblock %>