Skip to content

Commit

Permalink
More docs on syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
tailhook committed Aug 2, 2017
1 parent 4ebc312 commit bcc2169
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions doc/template_syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,34 @@ Here are the list of supported syntaxes:
as is with all whitespace. Statements always occupy the whole line
including indentation whitespace and trailing end of line.


If Statement
============

Conditional statement looks like::

## if something
output something
## endif

In any case lines containing ``## if`` and ``## endif`` do not put into output.
In ``indent`` syntax the inner indentation of the block is also stripped.


For Statement
=============

There are two forms of loop statements, for iterating over sequences:

## for var in value
output something
## endfor

And for iterating over dictionaries

## for key, value in var
{{ key }} = {{ value }}
## endfor

In any case lines containing ``## for`` and ``## endfor`` do not put into
output. In ``indent`` syntax the inner indentation of the block is also stripped.

0 comments on commit bcc2169

Please sign in to comment.