Reference
Attributes
Attributes can be assigned in similar fashion to output:
Elixir expressions can be used as attribute values using the interpolation syntax:
Boolean attributes can be set using boolean values:
There is a literal syntax for class and id attributes:
Elixir code
Elixir can be written inline using - and =.
- evalutes the expression.
= evalutes the expression, and inserts the value of the expression.
The interpolation syntax can be used to insert expressions into text:
Comments
Lines can be commented out using the `/` character:
HTML comments can be inserted using /!
Conditionals
We can use the regular Elixir flow control such as the if expression:
Doctypes
There are shortcuts for common doctypes:
Iteration
Elixir's collection manipulation expressions can be used to iterate over collections in your templates: