Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting template comment syntax #573

Merged
merged 1 commit into from
May 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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