From 7bd0640cfb656b07d6a6ae4c91720eb9621d4748 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 2 Jan 2011 14:15:30 -0500 Subject: indirection is hard --- docs/narr/templates.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index 437b823e9..7ef8e1923 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -628,7 +628,7 @@ application's configuration section, e.g.: .. code-block:: ini :linenos: - [app:main] + [app:MyProject] use = egg:MyProject#app debug_templates = true -- cgit v1.2.3 From e7b5fe05297d46cc169bd2f255529952569d899c Mon Sep 17 00:00:00 2001 From: Blaise Laflamme Date: Wed, 12 Jan 2011 23:07:54 -0500 Subject: Changed some references from pylonshq.com to pylonsproject.org --- docs/narr/templates.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index 7ef8e1923..b97cc7be6 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -448,7 +448,7 @@ Here's what a simple :term:`Chameleon` ZPT template used under

Welcome to ${project}, an application generated by the pyramid web + href="http://docs.pylonsproject.org/projects/pyramid/dev/">pyramid web application framework.

@@ -744,7 +744,7 @@ look like:

Welcome to ${project}, an application generated by the pyramid web + href="http://docs.pylonsproject.org/projects/pyramid/dev/">pyramid web application framework.

-- cgit v1.2.3 From 70acd25f40f32fc6cbb3b5d38a695b8982b52a31 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 27 Jan 2011 23:06:55 -0500 Subject: module name contractions --- docs/narr/templates.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index b97cc7be6..ae212fe5e 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -203,7 +203,7 @@ may set attributes on the response that influence these values. Here's an example of changing the content-type and status of the response object returned by -:func:`pyramid.renderers.render_to_response`: +:func:`~pyramid.renderers.render_to_response`: .. code-block:: python :linenos: @@ -219,7 +219,7 @@ response object returned by return response Here's an example of manufacturing a response object using the result -of :func:`pyramid.renderers.render` (a string): +of :func:`~pyramid.renderers.render` (a string): .. code-block:: python :linenos: @@ -247,8 +247,8 @@ System Values Used During Rendering ----------------------------------- When a template is rendered using -:func:`pyramid.renderers.render_to_response` or -:func:`pyramid.renderers.render`, the renderer representing the +:func:`~pyramid.renderers.render_to_response` or +:func:`~pyramid.renderers.render`, the renderer representing the template will be provided with a number of *system* values. These values are provided in a dictionary to the renderer and include: @@ -282,7 +282,7 @@ variables. Templates Used as Renderers via Configuration --------------------------------------------- -An alternative to using :func:`pyramid.renderers.render_to_response` +An alternative to using :func:`~pyramid.renderers.render_to_response` to render templates manually in your view callable code, is to specify the template as a :term:`renderer` in your *view configuration*. This can be done with any of the @@ -299,7 +299,7 @@ The association of a template as a renderer for a :term:`view configuration` makes it possible to replace code within a :term:`view callable` that handles the rendering of a template. -Here's an example of using a :class:`pyramid.view.view_config` +Here's an example of using a :class:`~pyramid.view.view_config` decorator to specify a :term:`view configuration` that names a template renderer: @@ -456,8 +456,8 @@ Here's what a simple :term:`Chameleon` ZPT template used under Note the use of :term:`Genshi` -style ``${replacements}`` above. This is one of the ways that :term:`Chameleon` ZPT differs from standard ZPT. The above template expects to find a ``project`` key in the set -of keywords passed in to it via :func:`pyramid.renderers.render` or -:func:`pyramid.renderers.render_to_response`. Typical ZPT +of keywords passed in to it via :func:`~pyramid.renderers.render` or +:func:`~pyramid.renderers.render_to_response`. Typical ZPT attribute-based syntax (e.g. ``tal:content`` and ``tal:replace``) also works in these templates. @@ -480,7 +480,7 @@ passing the macro template, or even the macro itself, *into* the rendered template. To do this you can use the :func:`pyramid.renderers.get_renderer` API to retrieve the macro template, and pass it into the template being rendered via the dictionary returned by the view. For example, using a -:term:`view configuration` via a :class:`pyramid.view.view_config` decorator +:term:`view configuration` via a :class:`~pyramid.view.view_config` decorator that uses a :term:`renderer`: .. code-block:: python -- cgit v1.2.3 From b6ceaf60f307ad3204d125e28ddb15a454f9c103 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 28 Jan 2011 10:55:47 -0500 Subject: capitalizations --- docs/narr/templates.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index ae212fe5e..d6d9a4e3e 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -606,7 +606,7 @@ configure your application development environment so that exceptions generated by Chameleon during template compilation and execution will contain nicer debugging information. -.. warning:: template-debugging behavior is not recommended for +.. warning:: Template-debugging behavior is not recommended for production sites as it slows renderings; it's usually only desirable during development. @@ -769,7 +769,7 @@ appear immediately without needing to restart the application process. environment so that a change to a template will be automatically detected, and the template will be reloaded on the next rendering. -.. warning:: auto-template-reload behavior is not recommended for +.. warning:: Auto-template-reload behavior is not recommended for production sites as it slows rendering slightly; it's usually only desirable during development. -- cgit v1.2.3 From 5f729e1c584eb647009a83a576715df7605eacb4 Mon Sep 17 00:00:00 2001 From: Chris Beelby Date: Fri, 28 Jan 2011 15:09:13 -0500 Subject: Removed reference to Zope XML namespace since this is a Mako example. Also Mako in general does not require such well-formed documents and it is perhaps more accurate of a typical mako template to make the example very basic. --- docs/narr/templates.rst | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index b97cc7be6..f50f6c173 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -733,12 +733,8 @@ look like: .. code-block:: xml :linenos: - - + - ${project} Application @@ -750,7 +746,7 @@ look like: This template doesn't use any advanced features of Mako, only the -``${squiggly}`` replacement syntax for names that are passed in as +``${}`` replacement syntax for names that are passed in as :term:`renderer globals`. See the `the Mako documentation `_ to use more advanced features. -- cgit v1.2.3 From edf3948f4ffe3914fd6382cc3f432b5c9b86288b Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 29 Jan 2011 00:55:37 -0500 Subject: renderings --- docs/narr/templates.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index d6d9a4e3e..d37e9722b 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -744,8 +744,8 @@ look like:

Welcome to ${project}, an application generated by the pyramid web - application framework.

+ href="http://docs.pylonsproject.org/projects/pyramid/dev/" + >pyramid web application framework. -- cgit v1.2.3 From 2a68620e62a1cadb146510b7584709e272ce42df Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 30 Jan 2011 17:12:49 -0500 Subject: too-long line --- docs/narr/templates.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index d37e9722b..5481a971b 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -448,7 +448,8 @@ Here's what a simple :term:`Chameleon` ZPT template used under

Welcome to ${project}, an application generated by the pyramid web + href="http://docs.pylonsproject.org/projects/pyramid/dev/" + >pyramid web application framework.

-- cgit v1.2.3 From 3d812457d868434278603441976e91172423e717 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 25 Feb 2011 13:59:39 -0500 Subject: typo --- docs/narr/templates.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'docs/narr/templates.rst') diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index a9cdc13fb..426ec229b 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -698,10 +698,9 @@ has built-in bindings for the Mako templating system. The language definition documentation for Mako templates is available from `the Mako website `_. -To use a Mako template, given a :term:`Mako` ZPT template file named -``foo.mak`` in the ``templates`` subdirectory in your application -package named ``mypackage``, you can configure the template as a -:term:`renderer` like so: +To use a Mako template, given a :term:`Mako` template file named ``foo.mak`` +in the ``templates`` subdirectory in your application package named +``mypackage``, you can configure the template as a :term:`renderer` like so: .. code-block:: python :linenos: -- cgit v1.2.3