Skip to content

Commit

Permalink
Update docs on conditional syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
lunabunn committed May 21, 2023
1 parent 2cc52bd commit ce762f1
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions SYNTAX.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ Documents the template syntax.

## Table of Contents

- [Expressions](#expressions)
- [Literals](#literals)
- [Values](#values)
- [Filters](#filters)
- [Blocks](#blocks)
- [Conditionals](#conditionals)
- [Loops](#loops)
- [With](#with)
- [Include](#include)
- [Whitespace control](#whitespace-control)
- [syntax](#syntax)
- [Table of Contents](#table-of-contents)
- [Expressions](#expressions)
- [Literals](#literals)
- [Values](#values)
- [Filters](#filters)
- [Blocks](#blocks)
- [Conditionals](#conditionals)
- [Loops](#loops)
- [With](#with)
- [Include](#include)
- [Whitespace control](#whitespace-control)


An `upon` template is simply a piece of UTF-8 text. It can be embedded in
Expand Down Expand Up @@ -103,8 +105,10 @@ Conditionals are marked using an opening `if` block and a closing `endif`
block. It can also have zero or more optional `else if` clauses and an
optional `else` clause. A conditional renders the contents of the block
based on the specified condition which can be any
[**expression**](#expressions) but it must resolve to a boolean value. A
boolean expression can be negated by applying the prefix `not`.
[**expression**](#expressions). None, `false`, zero floats and integers,
as well as empty strings, maps, and lists are considered falsy. Everything
else is considered truthy. A boolean expression can be negated by applying
the prefix `not`.

Consider the following template. If the nested field `user.is_enabled` is
returns `false` then the first paragraph would be rendered. Otherwise if
Expand Down

0 comments on commit ce762f1

Please sign in to comment.