@@ -8,21 +8,21 @@ title: YAML Configuration - Include Files
88` !include ` inserts the referenced file or structure exactly at the position where the include appears.
99
1010openHAB supports including external YAML files to facilitate modular, reusable, and maintainable configurations.
11- This is especially useful for templating , creating device [ packages] ( packages.md ) , or separating concerns across multiple files.
11+ This is especially useful for modular reuse , creating device [ packages] ( packages.md ) , or separating concerns across multiple files.
1212
1313[[ toc]]
1414
1515## Syntax Options
1616
17- ### Simple Syntax
17+ ### Short Form
1818
1919``` yaml
2020keyname : !include filename.inc.yaml
2121` ` `
2222
23- Use this when no variable overrides are needed .
23+ Use this when you don’t need to explicitly pass any variables .
2424
25- ### Full Syntax
25+ ### Long Form (supports variables)
2626
2727` ` ` yaml
2828# Block style (multi-line)
@@ -32,15 +32,16 @@ keyname: !include
3232 var1 : value1
3333 var2 : value2
3434
35- # Or inline style (single-line)
35+ # Or flow style (single-line)
3636keyname : !include { file: filename.inc.yaml, vars: { var1: value1, var2: value2 } }
3737` ` `
3838
39- In the full syntax, the ` vars` section is optional.
39+ The ` vars:` mapping is layered on top of the file’s current variables to form the evaluation context.
40+ In the long form, the `vars:` section is optional.
4041
4142:: : tip Passing Existing Variables to Included Files
4243
43- The `vars` section of an `!include` directive can contain literal values or references to **existing variables**.
44+ The `vars: ` section of an `!include` directive can contain literal values or references to **existing variables**.
4445
4546Example :
4647
0 commit comments