diff --git a/packages/spacebars/README.md b/packages/spacebars/README.md index eeabe0f9d0..65f278608a 100644 --- a/packages/spacebars/README.md +++ b/packages/spacebars/README.md @@ -495,6 +495,25 @@ We can write {{foo}} and it doesn't matter. Comment tags can be used wherever other template tags are allowed. +## Nested sub-expressions + +Sometimes an argument to a helper call is best expressed as a return value of +some other expression. For this and other cases, one can use parentheses to +express the evaluation order of nested expressions. + +```handlebars +{{capitalize (getSummary post)}} +``` + +In this example, the result of the `getSummary` helper call will be passed to +the `capitalize` helper. + +Sub-expressions can be used to calculate key-word arguments, too: + +```handlebars +{{> tmpl arg=(helper post)}} +``` + ## HTML Dialect Spacebars templates are written in [standard