You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/syntax/tabs.md
+124-2Lines changed: 124 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,11 @@ title: Tabs
4
4
5
5
Tabbed content is created using the `tab-set` directive with individual `tab-item` blocks for each tab's content. You can embed other directives, like admonitions directly in tabs.
6
6
7
-
## Syntax
7
+
## Tabs Simple
8
+
9
+
### Example
10
+
11
+
#### Syntax
8
12
9
13
```markdown
10
14
::::{tab-set}
@@ -20,6 +24,8 @@ This is where the content for tab #2 goes.
20
24
::::
21
25
```
22
26
27
+
#### Example
28
+
23
29
::::{tab-set}
24
30
25
31
:::{tab-item} Tab #1 title
@@ -32,6 +38,121 @@ This is where the content for tab #2 goes.
32
38
33
39
::::
34
40
41
+
---
42
+
43
+
## Tab Groups
44
+
45
+
Tabs can be grouped together by setting the `group` attribute to the same value for each `tab-set`.
46
+
This allows for multiple sets of tabs to be controlled together.
47
+
48
+
You need to set both the `group` and `sync` attributes to the same value for each `tab-item` to sync the tabs.
49
+
50
+
This means tabs with the same group and the same sync value will be selected together.
51
+
52
+
### Example
53
+
54
+
In the following example we have three tab sets, but only the first two are grouped together.
55
+
Hence, the first two tab sets will be in sync, but the third tab set will not be in sync with the first two.
56
+
57
+
#### Syntax
58
+
```markdown
59
+
::::{tab-set}
60
+
:group: languages // This is the group name
61
+
:::{tab-item} Java
62
+
:sync: java // This is the sync name
63
+
Content for Java tab
64
+
:::
65
+
66
+
:::{tab-item} Golang
67
+
:sync: golang
68
+
Content for Golang tab
69
+
:::
70
+
71
+
:::{tab-item} C#
72
+
:sync: csharp
73
+
Content for C# tab
74
+
:::
75
+
76
+
::::
77
+
78
+
::::{tab-set}
79
+
:group: languages
80
+
:::{tab-item} Java
81
+
:sync: java
82
+
Content for Java tab
83
+
:::
84
+
85
+
:::{tab-item} Golang
86
+
:sync: golang
87
+
Content for Golang tab
88
+
:::
89
+
90
+
:::{tab-item} C#
91
+
:sync: csharp
92
+
Content for C# tab
93
+
:::
94
+
95
+
::::
96
+
```
97
+
98
+
#### Result
99
+
100
+
::::{tab-set}
101
+
:group: languages
102
+
:::{tab-item} Java
103
+
:sync: java
104
+
Content for Java tab
105
+
:::
106
+
107
+
:::{tab-item} Golang
108
+
:sync: golang
109
+
Content for Golang tab
110
+
:::
111
+
112
+
:::{tab-item} C#
113
+
:sync: csharp
114
+
Content for C# tab
115
+
:::
116
+
117
+
::::
118
+
119
+
::::{tab-set}
120
+
:group: languages
121
+
:::{tab-item} Java
122
+
:sync: java
123
+
Other content for Java tab
124
+
:::
125
+
126
+
:::{tab-item} Golang
127
+
:sync: golang
128
+
Other content for Golang tab
129
+
:::
130
+
131
+
:::{tab-item} C#
132
+
:sync: csharp
133
+
Other content for C# tab
134
+
:::
135
+
::::
136
+
137
+
::::{tab-set}
138
+
:group: no-group
139
+
:::{tab-item} Java
140
+
:sync: java
141
+
Other content for Java tab
142
+
:::
143
+
144
+
:::{tab-item} Golang
145
+
:sync: golang
146
+
Other content for Golang tab that is not in the same group
147
+
:::
148
+
149
+
:::{tab-item} C#
150
+
:sync: csharp
151
+
Other content for Golang tab that is not in the same group
152
+
:::
153
+
154
+
::::
155
+
35
156
## Asciidoc syntax
36
157
37
158
`````asciidoc
@@ -79,4 +200,5 @@ This is where the content for tab #1 goes.
0 commit comments