Skip to content

Commit 5a43877

Browse files
committed
create shortcode for markdown tabs
1 parent b87727b commit 5a43877

File tree

8 files changed

+106
-42
lines changed

8 files changed

+106
-42
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.tabpane-md {
2+
border-style: outset;
3+
border-width: thin;
4+
}
5+
6+
.tabpane-md .tab-pane {
7+
padding: 10px;
8+
}

website_and_docs/assets/scss/main.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
@import "images";
88
@import "links";
99
@import "logo";
10-
@import "screen";
10+
@import "screen";
11+
@import "tabpane-md";

website_and_docs/content/documentation/webdriver/getting_started/install_selenium_library.en.md

+17-12
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ aliases: [
1010
]
1111
---
1212

13-
First you need to install the Selenium bindings for your automation project.
14-
The installation process for libraries depends on the language you choose to use.
13+
The installation process for libraries depends on the language you choose to use:
1514

16-
### Java
15+
{{< tabpane-md paneID="2" tabCount="6" headerTab1="Java" headerTab2="Python" headerTab3="CSharp" headerTab4="Ruby" headerTab5="JavaScript" headerTab6="Kotlin" >}}
16+
{{< tab-md ID="1" >}}
1717
Installation of Selenium libraries for Java is accomplished using a build tool.
1818
You can find the latest version on [Selenium Downloads](/downloads/) and see all available versions on
1919
[Maven Repository](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java)
@@ -28,14 +28,14 @@ For Maven, add the _selenium-java_ dependency in your project `pom.xml` file:
2828
</dependency>
2929
```
3030

31-
For Gradle, add the _selenium-java_ dependency in your project `build.gradle` file:
31+
For Gradle, add the _selenium-java_ dependency in your project `build.gradle` file:
3232

3333
```text
3434
dependencies {
3535
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '4.0.0'
3636
```
37-
38-
### Python
37+
{{< /tab-md >}}
38+
{{< tab-md ID="2" >}}
3939
Installation of Selenium libraries for Python can be done using pip:
4040

4141
```shell
@@ -49,7 +49,8 @@ Alternatively you can download the [PyPI source archive](https://pypi.org/projec
4949
python setup.py install
5050
```
5151

52-
### C#
52+
{{< /tab-md >}}
53+
{{< tab-md ID="3" >}}
5354
Installation of Selenium libraries for C# can be done using NuGet:
5455

5556
```shell
@@ -58,8 +59,8 @@ Install-Package Selenium.WebDriver
5859
# or using .Net CLI
5960
dotnet add package Selenium.WebDriver
6061
```
61-
62-
### Ruby
62+
{{< /tab-md >}}
63+
{{< tab-md ID="4" >}}
6364
Installation of Selenium libraries for Ruby can be done using gem:
6465

6566
```shell
@@ -72,13 +73,17 @@ Or add it to your `Gemfile`:
7273
gem 'selenium-webdriver', '~> 4.0'
7374
```
7475

75-
### JavaScript
76+
{{< /tab-md >}}
77+
{{< tab-md ID="5" >}}
7678
Installation of Selenium libraries for JavaScript can be done using npm:
7779

7880
```shell
7981
npm install selenium-webdriver
8082
```
8183

82-
### Kotlin
83-
Due to missing native language bindings for Kotlin, you have to use the
84+
{{< /tab-md >}}
85+
{{< tab-md ID="6" >}}
86+
Due to missing native language bindings for Kotlin, you have to use the
8487
Java Bindings, e.g. with maven [Java](#java)
88+
{{< /tab-md >}}
89+
{{< /tabpane-md >}}

website_and_docs/content/documentation/webdriver/getting_started/install_selenium_library.ja.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ aliases: [
1414
最初にあなたの自動化プロジェクトにSeleniumのバインディングをインストールする必要があります。
1515
インストールの方法は選択した言語によって異なります。
1616

17-
### Java
17+
{{< tabpane-md paneID="2" tabCount="6" headerTab1="Java" headerTab2="Python" headerTab3="CSharp" headerTab4="Ruby" headerTab5="JavaScript" headerTab6="Kotlin" >}}
18+
{{< tab-md ID="1" >}}
1819
JavaへのSeleniumライブラリのインストールはMavenを使います。
1920
プロジェクトのpom.xmlに _selenium-java_ の依存関係を追加してください。
2021

@@ -48,7 +49,8 @@ _selenium-java_ 依存関係は、Seleniumがサポートする全てのブラ
4849
</dependency>
4950
```
5051

51-
### Python
52+
{{< /tab-md >}}
53+
{{< tab-md ID="2" >}}
5254
PythonへのSeleniumライブラリのインストールはpipを使います。
5355

5456
```shell
@@ -62,7 +64,8 @@ pip install selenium
6264
python setup.py install
6365
```
6466

65-
### C#
67+
{{< /tab-md >}}
68+
{{< tab-md ID="3" >}}
6669
C#へのSeleniumライブラリのインストールはNuGetを使います。
6770

6871
```shell
@@ -72,21 +75,25 @@ Install-Package Selenium.WebDriver
7275
dotnet add package Selenium.WebDriver
7376
```
7477

75-
### Ruby
78+
{{< /tab-md >}}
79+
{{< tab-md ID="4" >}}
7680
RubyへのSeleniumライブラリのインストールはgemを使います。
7781

7882
```shell
7983
gem install selenium-webdriver
8084
```
8185

82-
## _JavaScript_
86+
{{< /tab-md >}}
87+
{{< tab-md ID="5" >}}
8388
JavaScriptへのSeleniumライブラリのインストールはnpmを使います。
8489

8590
```shell
8691
npm install selenium-webdriver
8792
```
8893

89-
### Kotlin
90-
Due to missing native language bindings for Kotlin, you have to use the
94+
{{< /tab-md >}}
95+
{{< tab-md ID="6" >}}
96+
Due to missing native language bindings for Kotlin, you have to use the
9197
Java Bindings, e.g. with maven [Java](#java)
9298

99+
{{< /tabpane-md >}}

website_and_docs/content/documentation/webdriver/getting_started/install_selenium_library.pt-br.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ aliases: [
1414
Primeiro você precisa instalar as ligações Selenium para seu projeto de automação.
1515
O processo de instalação de bibliotecas depende da linguagem que você escolher usar.
1616

17-
### Java
17+
{{< tabpane-md paneID="2" tabCount="6" headerTab1="Java" headerTab2="Python" headerTab3="CSharp" headerTab4="Ruby" headerTab5="JavaScript" headerTab6="Kotlin" >}}
18+
{{< tab-md ID="1" >}}
1819
A instalação de bibliotecas Selenium para Java pode ser feita usando Maven.
1920
Adicione a dependência selenium-java em seu pom.xml:
2021

@@ -26,7 +27,7 @@ Adicione a dependência selenium-java em seu pom.xml:
2627
</dependency>
2728
```
2829

29-
A dependência _selenium-java_ suporta a execução de sua automação com todos os navegadores
30+
A dependência _selenium-java_ suporta a execução de sua automação com todos os navegadores
3031
com suporte Selenium. Se você quiser fazer testes
3132
apenas em um navegador específico, você pode adicionar a dependência para esse navegador
3233
em seu arquivo _pom.xml_.
@@ -40,7 +41,7 @@ arquivo para executar seus testes apenas no Firefox:
4041
<version>4.X</version>
4142
</dependency>
4243
```
43-
44+
4445
De maneira semelhante, se você deseja executar testes apenas no Chrome,
4546
você deve adicionar a seguinte dependência:
4647

@@ -51,8 +52,8 @@ você deve adicionar a seguinte dependência:
5152
<version>4.X</version>
5253
</dependency>
5354
```
54-
55-
### Python
55+
{{< /tab-md >}}
56+
{{< tab-md ID="2" >}}
5657
A instalação de bibliotecas Selenium para Python pode ser feita usando pip:
5758

5859
```shell
@@ -66,7 +67,8 @@ Como alternativa, você pode baixar o [arquivo de origem do PyPI](https://pypi.o
6667
python setup.py install
6768
```
6869

69-
### C#
70+
{{< /tab-md >}}
71+
{{< tab-md ID="3" >}}
7072
A instalação de bibliotecas Selenium para C# pode ser feita usando NuGet:
7173

7274
```shell
@@ -76,20 +78,22 @@ Install-Package Selenium.WebDriver
7678
dotnet add package Selenium.WebDriver
7779
```
7880

79-
### Ruby
81+
{{< /tab-md >}}
82+
{{< tab-md ID="4" >}}
8083
A instalação de bibliotecas Selenium para Ruby pode ser feita usando gem:
8184

8285
```shell
8386
gem install selenium-webdriver
8487
```
8588

86-
### JavaScript
89+
{{< /tab-md >}}
90+
{{< tab-md ID="5" >}}
8791
A instalação de bibliotecas Selenium para JavaScript pode ser feita usando npm:
8892

8993
```shell
9094
npm install selenium-webdriver
9195
```
92-
93-
### Kotlin
96+
{{< /tab-md >}}
97+
{{< tab-md ID="6" >}}
9498
Devido à ausência de vínculos de linguagem nativo para Kotlin, você deve usar vínculos Java, por exemplo, com Maven [Java](#java)
95-
99+
{{< /tabpane-md >}}

website_and_docs/content/documentation/webdriver/getting_started/install_selenium_library.zh-cn.md

+14-11
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ aliases: [
1414
首先,您需要为自动化项目安装 Selenium 绑定库。
1515
库的安装过程取决于您选择使用的语言。
1616

17-
### Java
18-
17+
{{< tabpane-md paneID="2" tabCount="6" headerTab1="Java" headerTab2="Python" headerTab3="CSharp" headerTab4="Ruby" headerTab5="JavaScript" headerTab6="Kotlin" >}}
18+
{{< tab-md ID="1" >}}
1919
可以使用 Maven 安装 Java 的 Selenium 库。
2020
在项目 pom.xml 中添加 _selenium-java_ 依赖项:
2121

@@ -49,8 +49,8 @@ _selenium-java_ 依赖项支持在所有 Selenium 支持的浏览器中运行自
4949
</dependency>
5050
```
5151

52-
### Python
53-
52+
{{< /tab-md >}}
53+
{{< tab-md ID="2" >}}
5454
可以使用 pip 安装 Python 的 Selenium 库:
5555

5656
```shell
@@ -64,8 +64,8 @@ pip install selenium
6464
python setup.py install
6565
```
6666

67-
### C#
68-
67+
{{< /tab-md >}}
68+
{{< tab-md ID="3" >}}
6969
可以使用 NuGet 安装 C# 的 Selenium 库:
7070

7171
```shell
@@ -75,21 +75,24 @@ Install-Package Selenium.WebDriver
7575
dotnet add package Selenium.WebDriver
7676
```
7777

78-
### Ruby
79-
78+
{{< /tab-md >}}
79+
{{< tab-md ID="4" >}}
8080
可以使用 gem 安装 Ruby 的 Selenium 库:
8181

8282
```shell
8383
gem install selenium-webdriver
8484
```
8585

86-
### JavaScript
87-
86+
{{< /tab-md >}}
87+
{{< tab-md ID="5" >}}
8888
可以使用 npm 安装 JavaScript 的 Selenium 库
8989

9090
```shell
9191
npm install selenium-webdriver
9292
```
9393

94-
### Kotlin
94+
{{< /tab-md >}}
95+
{{< tab-md ID="6" >}}
9596
由于缺少Kotlin的原生语言的绑定, 您不得不借助Java的生态环境, 例如Maven [Java](#java)
97+
98+
{{< /tabpane-md >}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!--https://github.com/google/docsy/commit/51a208b49d876ae0995d4b18e6779374b35ff2fa-->
2+
3+
{{ $tabID := .Get "ID" }}
4+
{{ $paneID := print (.Parent.Get "paneID") $tabID }}
5+
{{ $tab := (print "tab" $tabID) }}
6+
{{ if eq $tabID "1" }}
7+
<div class="tab-pane fade show active" id="tab{{ $paneID }}" role="tabpanel" aria-labelledby="nav-{{ $tab }}">
8+
{{ $.Inner | markdownify }}
9+
</div>
10+
{{ else }}
11+
<div class="tab-pane fade" id="tab{{ $paneID }}" role="tabpanel" aria-labelledby="nav-{{ $tab }}">
12+
{{ $.Inner | markdownify }}
13+
</div>
14+
{{ end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--https://github.com/google/docsy/commit/51a208b49d876ae0995d4b18e6779374b35ff2fa-->
2+
3+
<div class="tabpane-md">
4+
<div class="nav nav-tabs" id="nav-tab" role="tablist">
5+
{{ range $i, $sequence := (seq (.Get "tabCount")) }}
6+
{{ $paneID := $.Get "paneID" }}
7+
{{ $headerTab := (print "headerTab" $sequence) }}
8+
{{ $tabHREF := (print "tab" $paneID $sequence) }}
9+
{{ if eq $sequence 1 }}
10+
<a class="nav-item nav-link active" id="nav-{{ $paneID }}" data-toggle="tab" href="#{{ $tabHREF | urlize }}" role="tab"
11+
aria-controls="nav-home" aria-selected="true">{{ $.Get $headerTab }}</a>
12+
{{ else }}
13+
<a class="nav-item nav-link" id="nav-{{ $paneID }}" data-toggle="tab" href="#{{ $tabHREF | urlize }}" role="tab"
14+
aria-controls="nav-home" aria-selected="false">{{ $.Get $headerTab }}</a>
15+
{{ end }}
16+
{{ end }}
17+
</div>
18+
</nav>
19+
<div class="tab-content {{ .Get "content" }}" id="{{ $.Get "paneID" }}">
20+
{{ .Inner }}
21+
</div>
22+
</div>

0 commit comments

Comments
 (0)