Skip to content

Commit

Permalink
Update changelog & readme
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljones committed Feb 1, 2022
1 parent 3d34f4d commit dcf533c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Changelog

## Unreleased

- Added support for '{[ name ]}' syntax to allow for inserting string builder values into the
template using the underlying `append_builder` call instead of the `append` functon that we use
for strings.

Thank you to @michallepicki for the suggestion.

## 0.6.0

- Added support for 'for .. as .. in ..' syntax to allow associating a type with the items in the
list being iterated.

Thank you to @lpil for the suggestion.

## 0.5.0

- Added --version flag to executable to print out current version.
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Alpha. The error messages are poor and there will be plenty of flaws and oversig

The syntax is inspired by [Jinja](https://jinja.palletsprojects.com/).

### Value
### String Value

You can use `{{ name }}` syntax to insert the value of name into the rendered template. The
function generated from the template will have a labelled argument matching the identifier used.
Expand All @@ -53,6 +53,15 @@ function generated from the template will have a labelled argument matching the
{{ name }}
```

### String Builder Value

You can use `{[ name ]}` syntax to insert a string builder value into the rendered template. This
has the advantage of using [string_builder.append_builder](https://hexdocs.pm/gleam_stdlib/gleam/string_builder.html#append_builder) in the rendered template and so it more efficient for inserting content that is already in a string_builder. This could be used to insert content from another template.

```jinja
{[ name ]}
```

### If

You can use `{% %}` blocks to create an if-statement using the `if`, `else` and `endif` keywords.
Expand Down

0 comments on commit dcf533c

Please sign in to comment.