From cd0df6349ca7c50611db9af95c3d43b0bde0e607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 17 Nov 2022 22:57:18 +0100 Subject: [PATCH] docs: document how to use tabs inside tabs #388 --- exampleSite/content/shortcodes/tabs.en.md | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/exampleSite/content/shortcodes/tabs.en.md b/exampleSite/content/shortcodes/tabs.en.md index b71f12b1bd..f41edb0b03 100644 --- a/exampleSite/content/shortcodes/tabs.en.md +++ b/exampleSite/content/shortcodes/tabs.en.md @@ -160,3 +160,75 @@ See what happens to this tab view if you select **properties** tab from the prev ``` {{% /tab %}} {{< /tabs >}} + +### Nested Tabs + +In case you want to nest tabs, the parent tab that contains the subtabs needs to be declared with `{{}}` instead of `{{%/* tab */%}}`. Note, that in this case it is not possible to put markdown in the parent tab. + +````go +{{}} +{{}} + Simple text is possible here... + {{}} + {{%/* 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 */%}} + {{}} +{{}} + +{{}} + ...but no markdown + {{}} + {{%/* tab name="python" */%}} + ```python + print("Hello World!") + ``` + {{%/* /tab */%}} + {{%/* tab name="bash" */%}} + ```bash + echo "Hello World!" + ``` + {{%/* /tab */%}} + {{}} +{{}} +{{}} +```` + +{{< 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 >}}