@@ -111,15 +111,15 @@ can generate the same tabs in markdown with the `tabs` directive and class `tabs
111
111
~~~ liquid
112
112
{% tabs hello-world-demo class=tabs-scala-version %}
113
113
114
- {% tab 'Scala 2' for=hello-world-demo %}
114
+ {% tab 'Scala 2' %}
115
115
```scala
116
116
object hello extends App {
117
117
println("Hello, World!")
118
118
}
119
119
```
120
120
{% endtab %}
121
121
122
- {% tab 'Scala 3' for=hello-world-demo %}
122
+ {% tab 'Scala 3' %}
123
123
```scala
124
124
@main def hello() = println("Hello, World!")
125
125
```
@@ -134,12 +134,12 @@ It is crucial that you use the `tabs-scala-version` class to benefit from some c
134
134
- the tab picked will be remembered across the site, and when the user returns to the page after some time.
135
135
136
136
For code snippets that are valid in both Scala 2 and Scala 3, please use a single tab labelled
137
- “ Scala 2 and 3” (please note that the ` tabs-scala-version ` class is also dropped):
137
+ ` ' Scala 2 and 3' ` (please note that the ` tabs-scala-version ` class is also dropped):
138
138
139
139
<!-- {% raw %} -->
140
140
~~~ liquid
141
141
{% tabs scala-2-and-3-demo %}
142
- {% tab 'Scala 2 and 3' for=scala-2-and-3-demo %}
142
+ {% tab 'Scala 2 and 3' %}
143
143
```scala
144
144
List(1, 2, 3).map(x => x + 1).sum
145
145
```
@@ -148,6 +148,19 @@ List(1, 2, 3).map(x => x + 1).sum
148
148
~~~
149
149
<!-- {% endraw %} -->
150
150
151
+ For examples that only apply to either one of Scala 2 or 3, use the tabs ` 'Scala 2 Only' ` and ` 'Scala 3 Only' ` .
152
+
153
+ If you have a particularly long tab, for readability you can indicate which tab group it belongs to with
154
+ a parameter ` for=tab-group ` as in this example:
155
+ <!-- {% raw %} -->
156
+ ~~~ liquid
157
+ {% tabs my-tab-group class=tabs-scala-version %}
158
+ ...
159
+ {% tab 'Scala 3' for=my-tab-group %}
160
+ ...
161
+ ~~~
162
+ <!-- {% endraw %} -->
163
+
151
164
### Typechecked Examples
152
165
153
166
The site build process uses [ mdoc] ( https://scalameta.org/mdoc/ ) to typecheck
0 commit comments