Skip to content

Commit

Permalink
Removed spam link
Browse files Browse the repository at this point in the history
  • Loading branch information
anonymous authored and anandology committed Jan 5, 2011
1 parent 408fb96 commit 5d4eb3a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions templetor.md
Expand Up @@ -182,7 +182,7 @@ Here's an example:

print render.base(render.message('Hello, world!'))

The first line imports templetor. The second says that our templates are in the directory `templates/`. The third give all our templates access to the `len` function. The fourth grabs the template `message.html`, passes it the argument `'Hello, world!'`, passes the result of rendering it to the template `base.html` and prints the result. (If your templates don't end in `.html` or `.xml`, templetor will still find them, but it won't do its automatic HTML-encoding.)
The first line imports templetor. The second says that our templates are in the directory `templates/`. The third give all our templates access to the `len` function. The fourth grabs the template `message.html`, passes it the argument `'Hello, world!'`, passes the result of rendering it to [mcitp](http://www.buyitcert.com/mcitp.html) the template `base.html` and prints the result. (If your templates don't end in `.html` or `.xml`, templetor will still find them, but it won't do its automatic HTML-encoding.)

## Turning Off Filter
By default `template.render` will use `web.websafe` filter to do HTML-encoding. To turn it off, put a : after the $ as in:
Expand Down Expand Up @@ -213,7 +213,7 @@ Then in the template `foo.html`:
$:bar
more html

This replaces the `$:bar` with the output of the `render.bar()` call (which is why it must be `$:`/unfiltered, so that you get un-encoded HTML (unless you want something else of course)). You can pass variables in, in the same way:
This replaces the `$:bar` with the output of the `render.bar()` call (which is why it must be `$:`/unfiltered, so [ccnp](http://www.buyitcert.com/ccnp.html) that you get un-encoded HTML (unless you want something else of course)). You can pass variables in, in the same way:

print render.foo(render.bar(baz), qux)

Expand All @@ -227,4 +227,6 @@ In template foo (`foo.html`):
$def with (bar, qux)
html goes here
$:bar
Value of qux is $qux
Value of qux is $qux

## Links

0 comments on commit 5d4eb3a

Please sign in to comment.