From 9cafa36c9b9764f9f51693dded96fcbb40396246 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 18 Jul 2008 04:29:15 +0000 Subject: Placeholder. --- docs/index.rst | 1 + docs/narr/templates.rst | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 docs/narr/templates.rst (limited to 'docs') 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 +`_ +templating engine as its default +engine. This templating engine +complies with the `Zope Page +Template +`_ +template specification. + +``repoze.bfg`` also allows `XSL +Templates +`_ +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) -- cgit v1.2.3