From bb059421530a7ec200a94d90c2539df9021e4e86 Mon Sep 17 00:00:00 2001 From: Tom Corrigan Date: Mon, 25 Mar 2013 16:00:17 +1100 Subject: [PATCH] Fix filename for batch filter documentation --- doc/filters/batch.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++ doc/filters/batch.test | 45 --------------------------------------------- 2 files changed, 45 insertions(+), 45 deletions(-) create mode 100644 doc/filters/batch.rst delete mode 100644 doc/filters/batch.test diff --git a/doc/filters/batch.rst b/doc/filters/batch.rst new file mode 100644 index 0000000..4366b57 --- /dev/null +++ b/doc/filters/batch.rst @@ -0,0 +1,45 @@ +``batch`` +========= + +.. versionadded:: 1.12.3 + The batch filter was added in Twig 1.12.3. + +The ``batch`` filter "batches" items by returning a list of lists with the +given number of items. If you provide a second parameter, it is used to fill +missing items: + +.. code-block:: jinja + + {% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %} + + + {% for row in items|batch(3, 'No item') %} + + {% for column in row %} + + {% endfor %} + + {% endfor %} +
{{ column }}
+ +The above example will be rendered as: + +.. code-block:: jinja + + + + + + + + + + + + + + + + + +
abc
def
gNo itemNo item
diff --git a/doc/filters/batch.test b/doc/filters/batch.test deleted file mode 100644 index 4366b57..0000000 --- a/doc/filters/batch.test +++ /dev/null @@ -1,45 +0,0 @@ -``batch`` -========= - -.. versionadded:: 1.12.3 - The batch filter was added in Twig 1.12.3. - -The ``batch`` filter "batches" items by returning a list of lists with the -given number of items. If you provide a second parameter, it is used to fill -missing items: - -.. code-block:: jinja - - {% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %} - - - {% for row in items|batch(3, 'No item') %} - - {% for column in row %} - - {% endfor %} - - {% endfor %} -
{{ column }}
- -The above example will be rendered as: - -.. code-block:: jinja - - - - - - - - - - - - - - - - - -
abc
def
gNo itemNo item
-- 1.7.2.5