From 16cdd27071ef91a56150f1d47d1a51a141f6c55f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 10 Dec 2009 03:17:47 +0000 Subject: Fix overriding renderers rendering. --- docs/narr/views.rst | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'docs') diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 913f5cd88..e4eba6a0b 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -1604,23 +1604,34 @@ overriding a renderer is accomplished via :term:`ZCML` or via imperative configuration. For example, to add a renderer which renders views which have a -``renderer`` attribute that is a path that ends in ``.jinja``:: +``renderer`` attribute that is a path that ends in ``.jinja2``: .. topic:: Via ZCML - + .. code-block:: xml + :linenos: + + The ``factory`` attribute is a dotted Python name that must point to an implementation of a :term:`renderer`. - The ``name`` attribute + The ``name`` attribute is the renderer name. .. topic:: Via Imperative Configuration - from my.package import MyJinja2Renderer - config.add_renderer('.jinja', MyJinja2Renderer) + .. code-block:: python + :linenos: + + from my.package import MyJinja2Renderer + config.add_renderer('.jinja2', MyJinja2Renderer) + + The first argument is the renderer name. + + The second argument is a reference to an to an implementation of a + :term:`renderer`. A renderer implementation is usually a class which has the following interface: -- cgit v1.2.3