Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Differentiate between expressions that print and statements that don't (
#4546) [Preview](https://docs-getdbt-com-git-dbeatty-jinja-statements-dbt-labs.vercel.app/docs/build/jinja-macros#jinja) ## What are you changing in this pull request and why? Instigated by dbt-labs/dbt-core#9113 (comment) We want to briefly explain the differences between expressions that print out and statements that don't. At the same time, we don't want to fully replicate all the [Jinja documentation](https://jinja.palletsprojects.com/en/3.0.x/templates/). Here's a quick table to explain the behavioral differences between the types of delimiters ("curlies"): | Name | Delimiter | Executes | Prints | |------------|-------------|:--------:|:------:| | Expression | `{{ ... }}` | ✅ | ✅ | | Statement | `{% ... %}` | ✅ | ❌ | | Comment | `{# ... #}` | ❌ | ❌ | The Jinja docs for the different [types of delimiters](https://jinja.palletsprojects.com/en/3.0.x/templates/#synopsis:~:text=The%20default%20Jinja%20delimiters%20are%20configured%20as%20follows) has the advantage of being brief, but lacks clarity especially as it relates to whether statements print out or not (they don't). Since the [“do” aka expression-statement](https://jinja.palletsprojects.com/en/3.1.x/templates/#expression-statement) is an [optional extension](https://jinja.palletsprojects.com/en/3.0.x/extensions/#expression-statement) in Jinja, it isn't documented in list of [control structures](https://jinja.palletsprojects.com/en/3.0.x/templates/#list-of-control-structures). ## 🎩 <img width="600" alt="image" src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/23a302e0-d68e-42b4-baca-ff1fb36c4fb0"> ## Checklist - [x] Review the [Content style guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md) so my content adheres to these guidelines. - [x] I have checked that the preview renders correctly - [x] I have checked that the new links work correctly
- Loading branch information