From deaab8b47fdfe64f8bd1af1904cc4baafcde29df Mon Sep 17 00:00:00 2001 From: Philip Jenvey <pjenvey@underboss.org> Date: Wed, 25 Feb 2009 05:52:52 +0000 Subject: [PATCH] doc corrections fixes #100 --- doc/build/content/defs.txt | 4 ++-- doc/build/content/syntax.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/build/content/defs.txt b/doc/build/content/defs.txt index 4e5cd46..a7e6bf5 100644 --- a/doc/build/content/defs.txt +++ b/doc/build/content/defs.txt @@ -37,7 +37,7 @@ Since defs are just Python functions, you can define and pass arguments to them account name: ${accountname}, type ${type} </%def> -When you declare an argument signature for your def, they are required following normal Python conventions (i.e., all arguments are required except keyword arguments with a default value). This is in contrast to using context-level variables, which evaluate to `UNDEFINED` if you reference a name that does not exist. +When you declare an argument signature for your def, they are required to follow normal Python conventions (i.e., all arguments are required except keyword arguments with a default value). This is in contrast to using context-level variables, which evaluate to `UNDEFINED` if you reference a name that does not exist. ### Calling defs from Other Files {@name=remotedefs} @@ -171,7 +171,7 @@ Using the older `%call` syntax looks like: The `body()` can be executed multiple times or not at all. This means you can use def-call-with-content to build iterators, conditionals, etc: <%def name="lister(count)"> - % for x in range(1,count): + % for x in range(count): ${caller.body()} % endfor </%def> diff --git a/doc/build/content/syntax.txt b/doc/build/content/syntax.txt index 9f99783..d71971c 100644 --- a/doc/build/content/syntax.txt +++ b/doc/build/content/syntax.txt @@ -157,7 +157,7 @@ The `%def` tag defines a Python function which contains a set of content, that c ${myfunc(7)} -The %def tag is a lot more powerful than a plain Python def, as the Mako compiler provides many extra services with %def that you wouldn't normally have, such as the ability to export defs as template "methods", automatic propigation of the current `Context`, buffering/filtering/caching flags, and def calls with content, which enable packages of defs to be sent as arguments to other def calls (not as hard as it sounds). Get the full deal on what %def can do in [defs](rel:defs). +The %def tag is a lot more powerful than a plain Python def, as the Mako compiler provides many extra services with %def that you wouldn't normally have, such as the ability to export defs as template "methods", automatic propagation of the current `Context`, buffering/filtering/caching flags, and def calls with content, which enable packages of defs to be sent as arguments to other def calls (not as hard as it sounds). Get the full deal on what %def can do in [defs](rel:defs). #### <%namespace> -- GitLab