String changes

This commit is contained in:
Kovid Goyal 2021-02-25 07:28:16 +05:30
parent c69f2851f3
commit d5cb3aa7c0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -599,7 +599,7 @@ Both modes support classic **relational (comparison) operators**: ``==``, ``!=``
``<=``, ``>``, ``>=``. The operators return '1' if they evaluate to True, otherwise ''. They do case-insensitive ``<=``, ``>``, ``>=``. The operators return '1' if they evaluate to True, otherwise ''. They do case-insensitive
string comparison using lexical order. The binary operator ``in`` is supported. The left hand expression is interpreted string comparison using lexical order. The binary operator ``in`` is supported. The left hand expression is interpreted
as a regular expression pattern. The ``in`` operator evaluates to '1' if the pattern matches the value of the right hand expression. as a regular expression pattern. The ``in`` operator evaluates to '1' if the pattern matches the value of the right hand expression.
The match is case-insensive. The match is case-insensitive.
Examples: Examples:
@ -701,7 +701,7 @@ The full method signature is:
**Template writer: how to access the additional information** **Template writer: how to access the additional information**
You access the additional information (the `globals dict`) in a template using the template function You access the additional information (the ``globals`` dict) in a template using the template function
``globals(id[=expression] [, id[=expression]]*)`` ``globals(id[=expression] [, id[=expression]]*)``
where ``id`` is any legal variable name. This function checks whether the additional information provided by the developer where ``id`` is any legal variable name. This function checks whether the additional information provided by the developer
contains the name. If it does then the function assigns the provided value to a template local variable with that name. contains the name. If it does then the function assigns the provided value to a template local variable with that name.
@ -709,8 +709,8 @@ If the name is not in the additional information and if an ``expression`` is pro
the result is assigned to the local variable. If neither a value nor an expression is provided, the function assigns the result is assigned to the local variable. If neither a value nor an expression is provided, the function assigns
the empty string (``''``) to the local variable. the empty string (``''``) to the local variable.
A template can set a value in the globals dict using the template function A template can set a value in the ``globals`` dict using the template function
``set_globals(id[=expression] [, id[=expression]]*)``. This function sets the globals dict key:value pair ``id:value`` where ``set_globals(id[=expression] [, id[=expression]]*)``. This function sets the ``globals`` dict key:value pair ``id:value`` where
``value`` is the value of the template local variable ``id``. If that local variable doesn't exist then ``value`` is ``value`` is the value of the template local variable ``id``. If that local variable doesn't exist then ``value`` is
set to the result of evaluating ``expression``. set to the result of evaluating ``expression``.