@@ -6,7 +6,7 @@ description: >-
66 Conventions for contributions to the Selenium documentation and code examples
77---
88
9- Read our [ contributing documentation] ({{< ref contributing.md >}}) for complete instructions on
9+ Read our [ contributing documentation] ({{< ref contributing.md >}}) for complete instructions on
1010how to add content to this documentation.
1111
1212## Alerts
@@ -68,7 +68,7 @@ Selenium now has official translators for each of the supported languages.
6868 also add it to ` important_documentation.ja.md ` , ` important_documentation.pt-br.md ` ,
6969 ` important_documentation.zh-cn.md ` .
7070* If you make text changes in the English version, just make a Pull Request.
71- The new process is for issues to be created and tagged as needs translation based on
71+ The new process is for issues to be created and tagged as needs translation based on
7272 changes made in a given PR.
7373
7474## Code examples
@@ -81,24 +81,24 @@ and the code itself should be placed inside code tabs.
8181The Docsy code tabs look like this:
8282
8383{{< tabpane langEqualsHeader=true >}}
84- {{< tab header="Java" >}}
85- WebDriver driver = new ChromeDriver();
86- {{< /tab >}}
87- {{< tab header="Python" >}}
88- driver = webdriver.Chrome()
89- {{< /tab >}}
90- {{< tab header="CSharp" >}}
91- var driver = new ChromeDriver();
92- {{< /tab >}}
93- {{< tab header="Ruby" >}}
94- driver = Selenium::WebDriver.for : chrome
95- {{< /tab >}}
96- {{< tab header="JavaScript" >}}
97- let driver = await new Builder().forBrowser('chrome').build();
98- {{< /tab >}}
99- {{< tab header="Kotlin" >}}
100- val driver = ChromeDriver()
101- {{< /tab >}}
84+ {{< tab header="Java" >}}
85+ WebDriver driver = new ChromeDriver();
86+ {{< /tab >}}
87+ {{< tab header="Python" >}}
88+ driver = webdriver.Chrome()
89+ {{< /tab >}}
90+ {{< tab header="CSharp" >}}
91+ var driver = new ChromeDriver();
92+ {{< /tab >}}
93+ {{< tab header="Ruby" >}}
94+ driver = Selenium::WebDriver.for : chrome
95+ {{< /tab >}}
96+ {{< tab header="JavaScript" >}}
97+ let driver = await new Builder().forBrowser('chrome').build();
98+ {{< /tab >}}
99+ {{< tab header="Kotlin" >}}
100+ val driver = ChromeDriver()
101+ {{< /tab >}}
102102{{< /tabpane >}}
103103
104104To generate the above tabs, this is what you need to write.
@@ -132,7 +132,7 @@ and ensures that all tabs on the page with a language are set to the same thing.
132132To ensure that all code is kept up to date, our goal is to write the code in the repo where it
133133can be executed when Selenium versions are updated to ensure that everything is correct.
134134
135- All code examples to be in our
135+ All code examples to be in our
136136[ example directories] ( https://github.com/SeleniumHQ/seleniumhq.github.io/tree/dev/examples ) .
137137
138138This code can be automatically displayed in the documentation using the ` gh-codeblock ` shortcode.
@@ -149,52 +149,52 @@ A basic comparison of code looks like:
149149
150150 {{</* tabpane text=true */>}}
151151 {{</* tab header="Java" */>}}
152- {{</* gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L46-L47 " */>}}
152+ {{</* gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L26-L27 " */>}}
153153 {{</* /tab */>}}
154154 {{</* tab header="Python" */>}}
155- {{</* gh-codeblock path="examples/python/tests/getting_started/first_script.py#L17- L18" */>}}
155+ {{</* gh-codeblock path="examples/python/tests/getting_started/first_script.py#L18-L19 " */>}}
156156 {{</* /tab */>}}
157157 {{</* tab header="CSharp" */>}}
158- {{</* gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScript.cs#L39-L40 " */>}}
158+ {{</* gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScript.cs#L25-L26 " */>}}
159159 {{</* /tab */>}}
160160 {{</* tab header="Ruby" */>}}
161- {{</* gh-codeblock path="examples/ruby/spec/getting_started/first_script.rb#L16- L17" */>}}
161+ {{</* gh-codeblock path="examples/ruby/spec/getting_started/first_script.rb#L17-L18 " */>}}
162162 {{</* /tab */>}}
163163 {{</* tab header="JavaScript" */>}}
164- {{</* gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24 " */>}}
164+ {{</* gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L22-L23 " */>}}
165165 {{</* /tab */>}}
166166 {{</* tab header="Kotlin" */>}}
167- {{</* gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26 " */>}}
167+ {{</* gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L31-L32 " */>}}
168168 {{</* /tab */>}}
169169 {{</* /tabpane */>}}
170170
171171Which looks like this:
172172
173173{{< tabpane text=true >}}
174174{{< tab header="Java" >}}
175- {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L46-L47 " >}}
175+ {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L26-L27 " >}}
176176{{< /tab >}}
177177{{< tab header="Python" >}}
178- {{< gh-codeblock path="examples/python/tests/getting_started/first_script.py#L17- L18" >}}
178+ {{< gh-codeblock path="examples/python/tests/getting_started/first_script.py#L18-L19 " >}}
179179{{< /tab >}}
180180{{< tab header="CSharp" >}}
181- {{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScript.cs#L39-L40 " >}}
181+ {{< gh-codeblock path="examples/dotnet/SeleniumDocs/GettingStarted/FirstScript.cs#L25-L26 " >}}
182182{{< /tab >}}
183183{{< tab header="Ruby" >}}
184- {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script.rb#L16- L17" >}}
184+ {{< gh-codeblock path="examples/ruby/spec/getting_started/first_script.rb#L17-L18 " >}}
185185{{< /tab >}}
186186{{< tab header="JavaScript" >}}
187- {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L23-L24 " >}}
187+ {{< gh-codeblock path="examples/javascript/test/getting_started/firstScript.spec.js#L22-L23 " >}}
188188{{< /tab >}}
189189{{< tab header="Kotlin" >}}
190- {{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L25-L26 " >}}
190+ {{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/getting_started/FirstScriptTest.kt#L31-L32 " >}}
191191{{< /tab >}}
192192{{< /tabpane >}}
193193
194194### Using Markdown in a Tab
195195
196196If you want your example to include something other than code (default) or html (from ` gh-codeblock ` ),
197- you need to first set ` text=true ` ,
197+ you need to first set ` text=true ` ,
198198then change the Hugo syntax for the ` tab ` to use ` % ` instead of ` < ` and ` > ` with curly braces:
199199
200200 {{</* tabpane text=true */>}}
@@ -213,14 +213,15 @@ This produces:
213213
214214{{< tabpane text=true >}}
215215{{% tab header="Java" %}}
216+
2162171 . Start the driver
217- {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L12" >}}
218+ {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L12" >}}
2182192 . Navigate to a page
219- {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L14" >}}
220+ {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L14" >}}
2202213 . Quit the driver
221- {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >}}
222- {{% /tab %}}
223- {{< /tabpane >}}
222+ {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/getting_started/FirstScript.java#L29" >}}
223+ {{% /tab %}}
224+ {{< /tabpane >}}
224225
225226This is preferred to writing code comments because those will not be translated.
226227Only include the code that is needed for the documentation, and avoid over-explaining.
0 commit comments