From 6012899c7d7bd4a5ffd64f0b9cede9639610ef41 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 22 Nov 2009 08:42:41 +0000 Subject: Rendering tweaks. --- docs/narr/views.rst | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'docs/narr/views.rst') diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 4f67d9663..2e574cb14 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -1645,9 +1645,12 @@ configured view. Here's an example of a renderer registration in ZCML: - +.. code-block:: xml + :linenos: + + Adding the above ZCML to your application will allow you to use the ``my.package.MyAMFRenderer`` renderer implementation in ``view`` @@ -1668,32 +1671,44 @@ thrown at rendering time. You can associate more than one filename extension with the same renderer implementation as necessary if you need to use a different file extension for the same kinds of templates. For example, to associate the ``.zpt`` extension with the -Chameleon page template renderer factory, use:: +Chameleon page template renderer factory, use: - +.. code-block:: xml + :linenos: + + To override the default mapping in which files with a ``.pt`` extension are rendered via a Chameleon ZPT page template renderer, use -a variation on the following in your application's ZCML:: +a variation on the following in your application's ZCML: - +.. code-block:: xml + :linenos: + + To override the default mapping in which files with a ``.txt`` extension are rendered via a Chameleon text template renderer, use a -variation on the following in your application's ZCML:: +variation on the following in your application's ZCML: - +.. code-block:: xml + :linenos: + + To associate a *default* renderer with *all* view configurations (even ones which do not possess a ``renderer`` attribute), use a variation on the following (ie. omit the ``name`` attribute to the renderer tag): - +.. code-block:: xml + :linenos: + + -- cgit v1.2.3