Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions docs/userGuide/syntax/variables.mbdf
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ In this case, all the variables in `title.md` are not accessible, as they are ov
You could also have your variables defined in a JSON file to define multiple variables in a more concise manner.

{{ icon_example }}
`variables.md`:
globally scoped variables `variables.md`:
```html {.no-line-numbers}
<variable from="variables.json" />
<variable from="PATH_TO_VARIABLE.json" />
```

`variables.json`:
Expand All @@ -177,7 +177,17 @@ You could also have your variables defined in a JSON file to define multiple var
}
```

Variables defined in JSON file will be scoped according to where it is being referenced.
Variables defined in a `.json` file will be scoped according to where it is being referenced. Json variables referenced in `variables.md`
would be globally scoped like other global variables in that file.

{{ icon_example }}
locally scoped variables in `index.md`:
```html
<variable from="PATH_TO_VARIABLE.json" />
```

In this case, json variables referenced within `index.md` would be a page variable accessible within the page `index.md`.



### Tips and Tricks for variables
Expand Down