Skip to content

Commit 7298004

Browse files
committed
Explain automatic grouping a bit better
1 parent 59e07e4 commit 7298004

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

docs/syntax/applies-switch.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,59 @@ Content for Serverless
7979

8080
## Automatic grouping
8181

82-
Applies switches are automatically grouped together by default. This means all applies switches on a page will sync with each other - when you select a version in one switch, all other switches will automatically switch to the same version.
82+
All applies switches on a page automatically sync together. When you select an applies_to definition in one switch, all other switches will switch to the same applies_to definition.
8383

84-
Items with the same applies_to definition will sync together across all switches on the page. For example, if you have `stack: preview 9.1` in multiple switches, selecting it in one will select it in all others.
84+
The format of the applies_to definition doesn't matter - `stack: preview 9.1`, `{ "stack": "preview 9.1" }`, and `{ stack: "preview 9.1" }` all identify the same content and will sync together.
8585

86-
In the following example we have two applies switch sets that are automatically grouped together.
87-
Hence, both switch sets will be in sync.
86+
In the following example, both switch sets are automatically grouped and will stay in sync.
87+
88+
::::::{tab-set}
89+
:::::{tab-item} Output
8890

8991
::::{applies-switch}
90-
:::{applies-item} stack: ga 9.0
92+
:::{applies-item} { "stack": "preview 9.0" }
93+
Content for 9.0 version
94+
:::
95+
:::{applies-item} { "stack": "ga 9.1" }
96+
Content for 9.1 version
97+
:::
98+
::::
99+
100+
::::{applies-switch}
101+
:::{applies-item} stack: preview 9.0
91102
Other content for 9.0 version
92103
:::
93104
:::{applies-item} stack: ga 9.1
94105
Other content for 9.1 version
95106
:::
96107
::::
97108

109+
:::::
110+
:::::{tab-item} Markdown
111+
112+
```markdown
113+
::::{applies-switch}
114+
:::{applies-item} { "ece": "ga 3.0" }
115+
Other content for ECE 3.0 version
116+
:::
117+
:::{applies-item} { "ece": "ga 4.0" }
118+
Other content for ECE 4.0 version
119+
:::
120+
::::
121+
98122
::::{applies-switch}
99-
:::{applies-item} stack: ga 9.0
123+
:::{applies-item} ece: ga 3.0
100124
Other content for 9.0 version
101125
:::
102-
:::{applies-item} stack: ga 9.1
126+
:::{applies-item} ece: ga 3.1
103127
Other content for 9.1 version
104128
:::
105129
::::
106130

131+
```
132+
:::::
133+
::::::
134+
107135
## Supported `applies_to` definitions
108136

109137
The `applies-item` directive accepts any valid applies_to definition that would work with the `{applies_to}` role.

0 commit comments

Comments
 (0)