Skip to content

Commit

Permalink
Merge pull request #573 from TonioGela/template_comment_syntax
Browse files Browse the repository at this point in the history
Documenting template comment syntax
  • Loading branch information
eed3si9n committed May 31, 2021
2 parents 4c03743 + f02f926 commit 9c688a7
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/03/00.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Dollar signs can be escaped to avoid resolution:
```
val foo = "foo"
val bar = "bar"
println(s"\\$foo\\$bar")
println(s"\\\$foo\\\$bar")
```

This would yield to:
Expand All @@ -105,6 +105,31 @@ val bar = "bar"
println(s"\$foo\$bar")
```

### Template comments

Sometimes it's useful to put a comment into a template that is intended for
template maintainers, and should not be included in the generated output.

Wrapping comments between `\$!` and `!\$` won't make them appear in the output.

```
\$! This comment won't appear in the output !\$
// This comment will appear in the output
\$!
This multiline comment won't appear either
No matter how
long it is
Internal \$substitutions\$ are ignored.
Even \$invalid\$ ones.
!\$
/*
* This comment is output and can contain \$substitutions\$
*/
```

### Conditionals

All fields have a property named `truthy` to be used in [conditional expressions][conditionals].
Expand Down

0 comments on commit 9c688a7

Please sign in to comment.