docs: document how to use tabs inside tabs #388

This commit is contained in:
Sören Weber 2022-11-17 22:57:18 +01:00
parent 8b8814d696
commit cd0df6349c
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -160,3 +160,75 @@ See what happens to this tab view if you select **properties** tab from the prev
``` ```
{{% /tab %}} {{% /tab %}}
{{< /tabs >}} {{< /tabs >}}
### Nested Tabs
In case you want to nest tabs, the parent tab that contains the subtabs needs to be declared with `{{</* tab */>}}` instead of `{{%/* tab */%}}`. Note, that in this case it is not possible to put markdown in the parent tab.
````go
{{</* tabs groupid="main" */>}}
{{</* tab name="Text" */>}}
Simple text is possible here...
{{</* tabs groupid="tabs-example-language" */>}}
{{%/* tab name="python" */%}}
Python is **super** easy.
- most of the time.
- if you don't want to output unicode
{{%/* /tab */%}}
{{%/* tab name="bash" */%}}
Bash is for **hackers**.
{{%/* /tab */%}}
{{</* /tabs */>}}
{{</* /tab */>}}
{{</* tab name="Code" */>}}
...but no markdown
{{</* tabs groupid="tabs-example-language" */>}}
{{%/* tab name="python" */%}}
```python
print("Hello World!")
```
{{%/* /tab */%}}
{{%/* tab name="bash" */%}}
```bash
echo "Hello World!"
```
{{%/* /tab */%}}
{{</* /tabs */>}}
{{</* /tab */>}}
{{</* /tabs */>}}
````
{{< tabs groupid="main" >}}
{{< tab name="Text" >}}
Simple text is possible here...
{{< tabs groupid="tabs-example-language" >}}
{{% tab name="python" %}}
Python is **super** easy.
- most of the time.
- if you don't want to output unicode
{{% /tab %}}
{{% tab name="bash" %}}
Bash is for **hackers**.
{{% /tab %}}
{{< /tabs >}}
{{< /tab >}}
{{< tab name="Code" >}}
...but no markdown
{{< tabs groupid="tabs-example-language" >}}
{{% tab name="python" %}}
```python
print("Hello World!")
```
{{% /tab %}}
{{% tab name="bash" %}}
```bash
echo "Hello World!"
```
{{% /tab %}}
{{< /tabs >}}
{{< /tab >}}
{{< /tabs >}}