From 0b5bb6e7b3a53f36872bc49e7c40da999eda02c0 Mon Sep 17 00:00:00 2001
From: Swen Wenzel <5111028+swenzel@users.noreply.github.com>
Date: Tue, 16 Mar 2021 18:21:57 +0100
Subject: [PATCH] Implement tab views (#386)
Tab views from @swenzel
---
exampleSite/content/shortcodes/tabs.en.md | 119 ++++++++++++++++++++++
layouts/partials/header.html | 1 +
layouts/shortcodes/tab.html | 12 +++
layouts/shortcodes/tabs.html | 21 ++++
static/css/tabs.css | 43 ++++++++
static/js/learn.js | 59 ++++++++++-
6 files changed, 252 insertions(+), 3 deletions(-)
create mode 100644 exampleSite/content/shortcodes/tabs.en.md
create mode 100644 layouts/shortcodes/tab.html
create mode 100644 layouts/shortcodes/tabs.html
create mode 100644 static/css/tabs.css
diff --git a/exampleSite/content/shortcodes/tabs.en.md b/exampleSite/content/shortcodes/tabs.en.md
new file mode 100644
index 0000000000..d664eeacaf
--- /dev/null
+++ b/exampleSite/content/shortcodes/tabs.en.md
@@ -0,0 +1,119 @@
+---
+title: Tabbed views
+description : "Synchronize selection of content in different tabbed views"
+---
+
+Choose which content to see across the page. Very handy for providing code
+snippets for multiple languages or providing configuration in different formats.
+
+## Code example
+
+ {{* tabs */>}}
+ {{%/* tab name="python" */%}}
+ ```python
+ print("Hello World!")
+ ```
+ {{%/* /tab */%}}
+ {{%/* tab name="R" */%}}
+ ```R
+ > print("Hello World!")
+ ```
+ {{%/* /tab */%}}
+ {{%/* tab name="Bash" */%}}
+ ```Bash
+ echo "Hello World!"
+ ```
+ {{%/* /tab */%}}
+ {{* /tabs */>}}
+
+Renders as:
+
+{{< tabs >}}
+{{% tab name="python" %}}
+```python
+print("Hello World!")
+```
+{{% /tab %}}
+{{% tab name="R" %}}
+```R
+> print("Hello World!")
+```
+{{% /tab %}}
+{{% tab name="Bash" %}}
+```Bash
+echo "Hello World!"
+```
+{{% /tab %}}
+{{< /tabs >}}
+
+Tab views with the same tabs that belong to the same group sychronize their selection:
+
+{{< tabs >}}
+{{% tab name="python" %}}
+```python
+print("Hello World!")
+```
+{{% /tab %}}
+{{% tab name="R" %}}
+```R
+> print("Hello World!")
+```
+{{% /tab %}}
+{{% tab name="Bash" %}}
+```Bash
+echo "Hello World!"
+```
+{{% /tab %}}
+{{< /tabs >}}
+
+## Config example
+
+ {{* tabs groupId="config" */>}}
+ {{%/* tab name="json" */%}}
+ ```json
+ {
+ "Hello": "World"
+ }
+ ```
+ {{%/* /tab */%}}
+ {{%/* tab name="XML" */%}}
+ ```xml
+