diff --git a/docs/templates.txt b/docs/templates.txt index b07883cbe8..5acd82f096 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -25,12 +25,12 @@ Below is a minimal template that illustrates the basic parts of a template. Each element will be explained later in this document.:: {% extends "base_generic" %} - + {% block title %}{{ section.title }}{% endblock %} - + {% block content %}
`` tags. Certain filters take arguments; a filter argument looks like this: ``{{ @@ -104,7 +104,7 @@ It's easiest to understand template inheritance by starting with an example::
{{ entry.body }}
{% endfor %} - + {% endblock %} - + The ``{% extends %}`` tag is the key here; it tells the template engine that this template "extends" another template. When this template is evaluated, the first step the template engine will perform is to locate the parent @@ -159,7 +159,7 @@ Depending on the value of ``blog_entries``, the output might look like::This is my first entry.
- +This is my second entry.
and
s
-
+
``linebreaksbr``
Converts newlines into
s
-
+
``linenumbers``
Displays text with line numbers
-
+
``ljust``
Left-aligns the value in a field of a given width
-
+
**Argument:** field size
-
+
``lower``
Converts a string into all lowercase
-
+
``make_list``
Returns the value turned into a list. For an integer, it's a list of
digits. For a string, it's a list of characters.
-
+
``phone2numeric``
Takes a phone number and converts it in to its numerical equivalent
-
+
``pluralize``
Returns 's' if the value is not 1, for '1 vote' vs. '2 votes'
-
+
``pprint``
A wrapper around pprint.pprint -- for debugging, really
-
+
``random``
Returns a random item from the list
-
+
``removetags``
Removes a space separated list of [X]HTML tags from the output
-
+
``rjust``
Right-aligns the value in a field of a given width
-
+
**Argument:** field size
-
+
``slice``
Returns a slice of the list.
-
+
Uses the same syntax as Python's list slicing; see
http://diveintopython.org/native_data_types/lists.html#odbchelper.list.slice
for an introduction.
-
+
``slugify``
Converts to lowercase, removes non-alpha chars and converts spaces to hyphens
-
+
``stringformat``
Formats the variable according to the argument, a string formatting specifier.
This specifier uses Python string formating syntax, with the exception that
the leading "%" is dropped.
-
+
See http://docs.python.org/lib/typesseq-strings.html for documentation
of Python string formatting
-
+
``striptags``
Strips all [X]HTML tags
-
+
``time``
Formats a time according to the given format (same as the ``now`` tag).
-
+
``timesince``
Formats a date as the time since that date (i.e. "4 days, 6 hours")
-
+
``title``
Converts a string into titlecase
-
+
``truncatewords``
Truncates a string after a certain number of words
-
+
**Argument:** Number of words to truncate after
-
+
``unordered_list``
Recursively takes a self-nested list and returns an HTML unordered list --
WITHOUT opening and closing