diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/index.rst | 1 | ||||
| -rw-r--r-- | docs/narr/templates.rst | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/docs/index.rst b/docs/index.rst index d6379048f..938520c73 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,6 +14,7 @@ Narrative documentation in chapter form explaining how to use narr/introduction narr/views + narr/templates narr/security API documentation diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst new file mode 100644 index 000000000..9f161855d --- /dev/null +++ b/docs/narr/templates.rst @@ -0,0 +1,35 @@ +Templates +========= + +A *template* is a file on disk which can be used to render data +provided by a *view* in a form that is meaningful for a particular +*context*. + +The ``repoze.bfg`` Default Templating Systems +--------------------------------------------- + +``repoze.bfg`` uses the `z3c.pt +<http://pypi.python.org/pypi/z3c.pt>`_ +templating engine as its default +engine. This templating engine +complies with the `Zope Page +Template +<http://wiki.zope.org/ZPT/FrontPage>`_ +template specification. + +``repoze.bfg`` also allows `XSL +Templates +<http://www.w3.org/TR/xslt>`_ +to be used for templating. + + +Rendering a ``z3c.pt`` Template +------------------------------- + +Given a template named ``foo.html`` +in a directory in your application +named "templates", you can render +the template in a view via:: + + from repoze.bfg.template import render template + render_template('templates/foo.html', foo=1, bar=2) |
