Skip to content

Commit d6171b7

Browse files
committed
implemented glossary tooltips
Signed-off-by: René <snooz@posteo.de>
1 parent 92e5027 commit d6171b7

11 files changed

Lines changed: 265 additions & 139 deletions

File tree

LOs.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ LO-2.5.2.3,(K1),Recall the concept of keywords with embedded arguments used in B
5050
LO-2.5.2.4,(K1),"Recall how ""Positional or Named Arguments"" are marked in the documentation and their use case.",,,
5151
LO-2.5.2.5,(K1),"Recall how ""Variable Number of Positional Arguments"" are marked in the documentation and their use case.",,,
5252
LO-2.5.2.6,(K1),"Recall what properties ""Named-Only Arguments"" have and how they are documented.",,,
53-
LO-2.5.2.7,(K1),Recall how free named arguments are marked in documentation.,,,
53+
LO-2.5.2.7,(K1),"Recall how ""Free Named Arguments"" are marked in documentation.",,,
5454
LO-2.5.2.8,(K2),Understand the concept of argument types and automatic type conversion.,,,
5555
LO-2.5.2.9,(K2),Understand the concept of return type hints.,,,
5656
LO-2.5.3,(K2),Understand how to read keyword documentation and how to interpret the examples.,,,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
- [`2.5.2.6 Named-Only Arguments`](website/docs/chapter-02/05_keyword_interface.md#2526-named-only-arguments)
114114
- LO-2.5.2.6 (K1) Recall what properties "Named-Only Arguments" have and how they are documented.
115115
- [`2.5.2.7 Free Named Arguments`](website/docs/chapter-02/05_keyword_interface.md#2527-free-named-arguments)
116-
- LO-2.5.2.7 (K1) Recall how free named arguments are marked in documentation.
116+
- LO-2.5.2.7 (K1) Recall how "Free Named Arguments" are marked in documentation.
117117
- [`2.5.2.8 Argument Types`](website/docs/chapter-02/05_keyword_interface.md#2528-argument-types)
118118
- LO-2.5.2.8 (K2) Understand the concept of argument types and automatic type conversion.
119119
- [`2.5.2.9 Return Types`](website/docs/chapter-02/05_keyword_interface.md#2529-return-types)

website/docs/chapter-01/04_styles.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ While **Keyword-Driven Testing (KDT)** and **Behavior-Driven Development (BDD)**
1616

1717
Both styles can be mixed, even within the same test or task, but it is strongly recommended to have separate styles for separate purposes and not mix them within the same body.
1818
One practical solution would be to define acceptance test cases that cover users' expectations in a declarative *Behavior-Driven Style*, while using keywords that are implemented in an imperative *Keyword-Driven style*.
19-
Further system level test cases, that are not covering acceptance criteria could be written in a *Keyword-Driven style*.
19+
Further system level :term[test cases](Test Case), that are not covering acceptance criteria could be written in a *Keyword-Driven style*.
2020

2121
The approach of both styles is different in that way,
2222
that the *Behavior-Driven Style* is a **declarative** specification,

website/docs/chapter-02/05_keyword_interface.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ All of them can be called positionally or by name.
7070

7171
![Run Process Keyword Documentation](/img/Run_Process_Docs.png)
7272

73-
This keyword has one :term[Mandatory Arguments]{tooltipMd="An **Argument** that must be set.<br/>See [Mandatory Args](chapter-03/03_user_keyword.md)"} `command` which can be called positionally or by name.
73+
This keyword has one Mandatory Arguments `command` which can be called positionally or by name.
7474
The latter two arguments are optional.
7575

76-
The argument `arguments` is a "Variable Number of Positional Arguments" and can only be set by position.
76+
The argument `arguments` is a :term[Variable Number of Positional Arguments] and can only be set by position.
7777
Therefore, if it shall be set, all preceding arguments must be set by position as well.
7878
See [2.5.2.5 Variable Number of Positional Arguments](chapter-02/05_keyword_interface.md#2525-variable-number-of-positional-arguments) for more information about this kind of argument.
7979

80-
The argument `configuration` is a "Free Named Argument" and can only be set by names.
80+
The argument `configuration` is a :term[Free Named Argument] and can only be set by names.
8181
See [2.5.2.7 Free Named Arguments](chapter-02/05_keyword_interface.md#2527-free-named-arguments) for more information about this kind of argument.
8282

8383

@@ -92,11 +92,11 @@ See [2.5.2.7 Free Named Arguments](chapter-02/05_keyword_interface.md#2527-free-
9292
This keyword has 2 "Mandatory Arguments" that can be called positionally or by name.
9393
The last two arguments are optional.
9494

95-
The argument `groups` is a "Variable Number of Positional Arguments" and can only be set by position.
95+
The argument `groups` is a :term[Variable Number of Positional Arguments] and can only be set by position.
9696
Therefore, if it shall be set, all preceding arguments must be set by position as well.
9797
See [2.5.2.5 Variable Number of Positional Arguments](chapter-02/05_keyword_interface.md#2525-variable-number-of-positional-arguments) for more information about this kind of argument.
9898

99-
The argument `flags` is a "Named-Only Argument" and can only be set by name.
99+
The argument `flags` is a :term[Named-Only Argument] and can only be set by name.
100100
See [2.5.2.6 Named-Only Arguments](chapter-02/05_keyword_interface.md#2526-named-only-arguments) for more information about this kind of argument.
101101

102102

@@ -118,20 +118,20 @@ The more business oriented keywords are the less arguments they typically have.
118118
Keyword arguments can be grouped into different argument kinds.
119119
On the one hand you can group them by their definition attributes and on the other hand by their usage kind.
120120

121-
The relevant distinction of usage kinds is between using **Positional Arguments**, **Named Arguments**, or **Embedded Arguments**.
121+
The relevant distinction of usage kinds is between using :term[Positional Arguments]{term="Positional Argument"}, :term[Named Arguments]{term="Named Argument"}, or :term[Embedded Arguments]{term="Embedded Argument"}.
122122
How to use them is described in [2.6 Writing Test|Task and Calling Keywords](chapter-02/06_writing_test.md).
123123

124124
Another important information is if an argument is mandatory or optional.
125125
See the next two sections for more information about these two kinds of arguments.
126126

127127
Most arguments can either be set by their position or by their name.
128-
But there are some kinds of arguments that can only be set positionally, like **Variable Number of Positional Arguments**, or only be set named, like **Named-Only Arguments** or **Free Named Arguments**.
128+
But there are some kinds of arguments that can only be set positionally, like :term[Variable Number of Positional Arguments], or only be set named, like :term[Named-Only Arguments]{term="Named-Only Argument"} or :term[Free Named Arguments]{term="Free Named Argument"}.
129129

130130
The order is as follows:
131-
1. **Positional or Named Arguments** (can be mandatory or optional)
132-
2. **Variable Number of Positional Arguments** (optional)
133-
3. **Named-Only Arguments** (can be mandatory or optional)
134-
4. **Free Named Arguments** (optional)
131+
1. :term[Positional or Named Arguments]{term="Positional or Named Argument"} (can be mandatory or optional)
132+
2. :term[Variable Number of Positional Arguments] (optional)
133+
3. :term[Named-Only Arguments]{term="Named-Only Argument"} (can be mandatory or optional)
134+
4. :term[Free Named Arguments]{term="Free Named Argument"} (optional)
135135

136136
### 2.5.2.1 Mandatory Arguments
137137

@@ -189,7 +189,7 @@ Arguments that have a default value can be omitted when the keyword is called, c
189189
These arguments are listed after the mandatory arguments in the argument interface.
190190
Default values are defined and represented in the docs by the equal sign `=` after the argument name and a value after that.
191191

192-
Also "Variable Number of Positional Arguments", represented with a single star (`*`) prefix, and "Free Named Arguments", represented with a double star (`**`) prefix are optional arguments.
192+
Also :term[Variable Number of Positional Arguments], represented with a single star (`*`) prefix, and :term[Free Named Arguments]{term="Free Named Argument"}, represented with a double star (`**`) prefix are optional arguments.
193193

194194
E.g. the argument `msg` in the `Should Be Equal` keyword documentation has the default value `None` and `ignore_case` has the default value `False`.
195195

@@ -233,7 +233,7 @@ Foundation Page should be Accessible
233233
And the url should be https://robotframework.org/foundation
234234
```
235235
The optional prefixes `Given`, `When`, `Then`, `And` and `But` are basically ignored by Robot Framework if a keyword is found matching the rest of the name including the embedded arguments.
236-
In the example test case some keywords are designed so that the arguments are surrounded by double quotes (`"`) for better visibility.
236+
In the example :term[test case] some keywords are designed so that the arguments are surrounded by double quotes (`"`) for better visibility.
237237

238238
A mix of embedded arguments and "normal" arguments is possible to fully support BDD.
239239
In the keyword documentation the embedded arguments are written in variable syntax with dollar-curly-braces (`${var_name}`) to indicate that they are not part of the keyword name but are arguments.
@@ -253,7 +253,7 @@ Recall how "Positional or Named Arguments" are marked in the documentation and t
253253
::::
254254

255255
Except for "Positional-Only Arguments", which are not part of this syllabus,
256-
all arguments that are positioned before "Variable Number of Positional Arguments", "Named-Only Arguments", or "Free Named Arguments" in the argument interface of a keyword are "Positional or Named Arguments".
256+
all arguments that are positioned before :term[Variable Number of Positional Arguments], :term[Named-Only Arguments]{term="Named-Only Argument"}, or :term[Free Named Arguments]{term="Free Named Argument"} in the argument interface of a keyword are :term[Positional or Named Arguments]{term="Positional or Named Argument"}.
257257

258258
As their name states, they can be set either by their position or by their name, but not by both at the same time for one argument.
259259
If an argument shall be set by its position, all preceding arguments must be set by their position as well.
@@ -275,7 +275,7 @@ Recall how "Variable Number of Positional Arguments" are marked in the documenta
275275

276276
::::
277277

278-
A special case of optional arguments that can only be set by their position are "Variable Number of Positional Arguments".
278+
A special case of optional arguments that can only be set by their position are :term[Variable Number of Positional Arguments].
279279
These are also referred to as `*args` or `*varargs` in Python.
280280
Some keywords need to collect a variable amount of values into one argument, because it is not possible to define the amount of values in advance.
281281

@@ -286,8 +286,8 @@ Depending on the command to be executed different amount of arguments are needed
286286
This variable argument is marked with a single asterisk `*` before the argument name in the keyword documentation.
287287

288288
When calling this keyword, the first positional argument is assigned to `command`, while all subsequent positional arguments are collected into `arguments`.
289-
Because of this behavior, no additional positional arguments can be used after these "Variable Number of Positional Arguments".
290-
As a result, any arguments following these "Variable Number of Positional Arguments" must be named arguments,
289+
Because of this behavior, no additional positional arguments can be used after these :term[Variable Number of Positional Arguments].
290+
As a result, any arguments following these :term[Variable Number of Positional Arguments] must be named arguments,
291291
regardless of whether they are mandatory or optional arguments with a default value.
292292

293293
Also see [2.5.1.3 Example Keyword `Get Regexp Matches`](chapter-02/05_keyword_interface.md#2513-example-keyword-get-regexp-matches).
@@ -305,30 +305,30 @@ Recall what properties "Named-Only Arguments" have and how they are documented.
305305

306306
::::
307307

308-
All arguments that are defined after a "Variable Number of Positional Arguments" (`*varargs`) are "Named-Only Arguments".
309-
However it is also possible to create "Named-Only Arguments without a preceding "Variable Number of Positional Arguments".
308+
All arguments that are defined after a :term[Variable Number of Positional Arguments] (`*varargs`) are :term[Named-Only Arguments]{term="Named-Only Argument"}.
309+
However it is also possible to create "Named-Only Arguments without a preceding :term[Variable Number of Positional Arguments].
310310

311-
"Named-Only Arguments" are marked with a "LABEL" sign `🏷` before the argument name in the keyword documentation.
311+
:term[Named-Only Arguments]{term="Named-Only Argument"} are marked with a "LABEL" sign `🏷` before the argument name in the keyword documentation.
312312

313-
Those arguments can not be set positionally. All positional values would be consumed by the "Variable Number of Positional Arguments".
313+
Those arguments can not be set positionally. All positional values would be consumed by the :term[Variable Number of Positional Arguments].
314314
So they must be called by their name followed by an equal sign `=` and the value of the argument.
315315

316-
"Named-Only Arguments" can be mandatory or optional with a default value.
316+
:term[Named-Only Arguments]{term="Named-Only Argument"} can be mandatory or optional with a default value.
317317

318318
### 2.5.2.7 Free Named Arguments
319319

320320
::::lo[Learning Objectives]
321321

322322
:::K1[LO-2.5.2.7]
323323

324-
Recall how free named arguments are marked in documentation.
324+
Recall how "Free Named Arguments" are marked in documentation.
325325

326326
:::
327327

328328
::::
329329

330-
Another special case of "Named-Only Arguments" are "Free Named Arguments."
331-
These arguments are similar to the "Variable Number of Positional Arguments" in that they can collect multiple values.
330+
Another special case of :term[Named-Only Arguments]{term="Named-Only Argument"} are :term[Free Named Arguments]{term="Free Named Argument"}.
331+
These arguments are similar to the :term[Variable Number of Positional Arguments] in that they can collect multiple values.
332332
However, instead of collecting positional values, they gather all named values that are not explicitly defined as argument names.
333333
In this case all values given to the keyword as arguments, that do contain an unescaped equal sign (`=`) are considered as named arguments.
334334

website/docs/chapter-02/06_writing_test.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Understand the concept of how to set argument values positionally.
7676
::::
7777

7878
When calling keywords, arguments can often be set positionally in the order they are defined in the keyword documentation.
79-
An exception to this are "Named-Only Arguments" and "Free Named Arguments" that can only be set by their name.
79+
An exception to this are :term[Named-Only Arguments]{term="Named-Only Argument"} and :term[Free Named Arguments]{term="Free Named Argument"} that can only be set by their name.
8080

8181
However, only using positional values can lead to poor readability as you can see in the previous example: `Mixed Positional Arguments`
8282
Some keywords do not have an obvious order of arguments.
@@ -100,7 +100,7 @@ Click on x and y
100100
Click On Coordinates x=82 y=70
101101
```
102102

103-
Calling keywords that have a "Variable Number of Positional Arguments" does require to set all preceding arguments by their position if the "Variable Number of Positional Arguments" shall be set.
103+
Calling keywords that have a :term[Variable Number of Positional Arguments] does require to set all preceding arguments by their position if the :term[Variable Number of Positional Arguments] shall be set.
104104

105105
Example:
106106
```robotframework
@@ -134,7 +134,7 @@ Also setting one optional argument but leaving the others at their default value
134134
Named arguments are set by their name followed by an equal sign `=` and the value of the argument.
135135
All named arguments must be set after the positional arguments are set but can be set in any order.
136136

137-
Equal signs are valid argument values and could therefore be misinterpreted as named arguments, if the text before the equal sign is an existing argument name or if "Free Named Arguments" are available at the called keyword.
137+
Equal signs are valid argument values and could therefore be misinterpreted as named arguments, if the text before the equal sign is an existing argument name or if :term[Free Named Arguments]{term="Free Named Argument"} are available at the called keyword.
138138
To prevent that, an equal sign in argument values can be escaped by a backslash `\`.
139139

140140
Example of escaping conflicting equal signs:

website/docs/chapter-03/03_user_keyword.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Understand the purpose and syntax of the [Arguments] setting in User Keywords.
157157
User Keywords can accept arguments, which make them more dynamic and reusable in various contexts.
158158
The `[Arguments]` setting is used to define the arguments a user keyword expects.
159159

160-
See also Chapter 2 [2.5.2 Keyword Arguments](chapter-02/05_keyword_interface.md#252-keyword-arguments) for an introduction to argument kinds.
160+
See also [2.5.2 Keyword Arguments](chapter-02/05_keyword_interface.md#252-keyword-arguments) for an introduction to argument kinds.
161161

162162
Arguments are defined by `[Arguments]` followed by the argument names separated by multiple spaces in the syntax of scalar variables.
163163

@@ -350,8 +350,8 @@ the user ${action}
350350

351351
### 3.3.5.4 Other Argument Kinds
352352

353-
Other argument kinds like **Named-Only Arguments**, **Free Named Arguments**, or
354-
**Variable Number of Positional Arguments** should be known,
353+
Other argument kinds like :term[Named-Only Arguments]{term="Named-Only Argument"}, :term[Free Named Arguments]{term="Free Named Argument"}, or
354+
:term[Variable Number of Positional Arguments] should be known,
355355
but their definition and usage are not part of this syllabus.
356356

357357

website/docs/learning_objectives.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
| [`LO-2.5.2.4`](chapter-02/05_keyword_interface.md#2524-positional-or-named-arguments) | K1 | Recall how "Positional or Named Arguments" are marked in the documentation and their use case. |
5353
| [`LO-2.5.2.5`](chapter-02/05_keyword_interface.md#2525-variable-number-of-positional-arguments) | K1 | Recall how "Variable Number of Positional Arguments" are marked in the documentation and their use case. |
5454
| [`LO-2.5.2.6`](chapter-02/05_keyword_interface.md#2526-named-only-arguments) | K1 | Recall what properties "Named-Only Arguments" have and how they are documented. |
55-
| [`LO-2.5.2.7`](chapter-02/05_keyword_interface.md#2527-free-named-arguments) | K1 | Recall how free named arguments are marked in documentation. |
55+
| [`LO-2.5.2.7`](chapter-02/05_keyword_interface.md#2527-free-named-arguments) | K1 | Recall how "Free Named Arguments" are marked in documentation. |
5656
| [`LO-2.5.2.8`](chapter-02/05_keyword_interface.md#2528-argument-types) | K2 | Understand the concept of argument types and automatic type conversion. |
5757
| [`LO-2.5.2.9`](chapter-02/05_keyword_interface.md#2529-return-types) | K2 | Understand the concept of return type hints. |
5858
| [`LO-2.5.3`](chapter-02/05_keyword_interface.md#253-keyword-documentation--examples) | K2 | Understand how to read keyword documentation and how to interpret the examples. |

website/src/components/Glossary/GlossaryTable.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const GlossaryTable: React.FC = () => {
123123
window.scrollTo({ top, behavior: 'smooth' });
124124
}
125125
},
126-
[aliasToCanonicalSlug]
126+
[]
127127
);
128128

129129
useEffect(() => {
@@ -211,13 +211,24 @@ const GlossaryTable: React.FC = () => {
211211
id={entry.slug}
212212
className={clsx({ [styles.activeRow]: activeSlug === entry.slug })}
213213
onClick={handleClick}
214+
tabIndex={0}
215+
role="button"
216+
onKeyDown={(event) => {
217+
if (
218+
(event.key === 'Enter' || event.key === ' ') &&
219+
event.target === event.currentTarget
220+
) {
221+
event.preventDefault();
222+
handleClick();
223+
}
224+
}}
214225
>
215226
<td className={clsx(styles.termCell, styles.clickable)}>
216227
<div className={styles.termName}>{entry.term}</div>
217228
</td>
218229
<td className={styles.definitionCell}>
219230
{entry.isAlias ? (
220-
// Hyperlink to term in alias definition cell
231+
// Hyperlink to term in alias definition cell
221232
<a
222233
href={`#${entry.targetSlug}`}
223234
className={styles.aliasLink}
@@ -245,7 +256,7 @@ const GlossaryTable: React.FC = () => {
245256
const aliasSlug = slugify(alias);
246257
const target = aliasToCanonicalSlug.get(aliasSlug) || aliasSlug;
247258
return (
248-
// Link to alias term
259+
// Link to alias term
249260
<a
250261
key={target}
251262
href={`#${aliasSlug}`}

0 commit comments

Comments
 (0)