Skip to content

Commit 93ceb95

Browse files
eksperimentaljosevalim
authored andcommitted
Simplify custom links when linking to Kernel and SpecialForms (#8528)
Now that ExDoc automatically links to functions in Kernel and Kernel.SpecialForms, when linking to them in custom links, we can leave out the module name.
1 parent 85ca87f commit 93ceb95

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

lib/elixir/pages/Guards.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Not all expressions are allowed in guard clauses, but only a handful of them. Th
88

99
You can find the built-in list of guards [in the `Kernel` module](Kernel.html#guards). Here is an overview:
1010

11-
* comparison operators ([`==`](`Kernel.==/2`), [`!=`](`Kernel.!=/2`), [`===`](`Kernel.===/2`), [`!==`](`Kernel.!==/2`),
12-
[`>`](`Kernel.>/2`), [`>=`](`Kernel.>=/2`), [`<`](`Kernel.</2`), [`<=`](`Kernel.<=/2`))
13-
* strictly boolean operators ([`and`](`Kernel.and/2`), [`or`](`Kernel.or/2`), [`not`](`Kernel.not/1`)). Note [`&&`](`Kernel.&&/2`), [`||`](`Kernel.||/2`), and [`!`](`Kernel.!/1`) sibling operators are **not allowed** as they're not *strictly* boolean - meaning they don't require arguments to be booleans
14-
* arithmetic unary and binary operators ([`+`](`Kernel.+/1`), [`-`](`Kernel.-/1`), [`+`](`Kernel.+/2`), [`-`](`Kernel.-/2`), [`*`](`Kernel.*/2`), [`/`](`Kernel.//2`))
15-
* [`in`](`Kernel.in/2`) and [`not in`](`Kernel.in/2`) operators (as long as the right-hand side is a list or a range)
16-
* "type-check" functions ([`is_list/1`](`Kernel.is_list/1`), [`is_number/1`](`Kernel.is_number/1`), etc.)
17-
* functions that work on built-in datatypes ([`abs/1`](`Kernel.abs/1`), [`map_size/1`](`Kernel.map_size/1`), etc.)
11+
* comparison operators ([`==`](`==/2`), [`!=`](`!=/2`), [`===`](`===/2`), [`!==`](`!==/2`),
12+
[`>`](`>/2`), [`>=`](`>=/2`), [`<`](`</2`), [`<=`](`<=/2`))
13+
* strictly boolean operators ([`and`](`and/2`), [`or`](`or/2`), [`not`](`not/1`)). Note [`&&`](`&&/2`), [`||`](`||/2`), and [`!`](`!/1`) sibling operators are **not allowed** as they're not *strictly* boolean - meaning they don't require arguments to be booleans
14+
* arithmetic unary and binary operators ([`+`](`+/1`), [`-`](`-/1`), [`+`](`+/2`), [`-`](`-/2`), [`*`](`*/2`), [`/`](`//2`))
15+
* [`in`](`in/2`) and [`not in`](`in/2`) operators (as long as the right-hand side is a list or a range)
16+
* "type-check" functions ([`is_list/1`](`is_list/1`), [`is_number/1`](`is_number/1`), etc.)
17+
* functions that work on built-in datatypes ([`abs/1`](`abs/1`), [`map_size/1`](`map_size/1`), etc.)
1818

1919
The module `Bitwise` also includes a handful of [Erlang bitwise operations as guards](Bitwise.html#guards).
2020

@@ -44,7 +44,7 @@ In the example above, we show how guards can be used in function clauses. There
4444
def foo(term) when is_float(term), do: round(term)
4545
```
4646

47-
* [`case`](`Kernel.SpecialForms.case/2`) expressions:
47+
* [`case`](`case/2`) expressions:
4848

4949
```elixir
5050
case x do
@@ -54,7 +54,7 @@ In the example above, we show how guards can be used in function clauses. There
5454
end
5555
```
5656

57-
* anonymous functions ([`fn`](`Kernel.SpecialForms.fn/1`)s):
57+
* anonymous functions ([`fn`](`fn/1`)s):
5858

5959
```elixir
6060
larger_than_two? = fn
@@ -63,10 +63,10 @@ In the example above, we show how guards can be used in function clauses. There
6363
end
6464
```
6565

66-
* custom guards can also be defined with `Kernel.defguard/1` and `Kernel.defguardp/1`.
66+
* custom guards can also be defined with `defguard/1` and `defguardp/1`.
6767
A custom guard is always defined based on existing guards.
6868

69-
Other constructs are [`for`](`Kernel.SpecialForms.for/1`), [`with`](`Kernel.SpecialForms.with/1`), [`try/rescue/catch/else`](`Kernel.SpecialForms.try/1`), and the `Kernel.match?/2`.
69+
Other constructs are [`for`](`for/1`), [`with`](`with/1`), [`try/rescue/catch/else`](`try/1`), and the `match?/2`.
7070

7171
## Failing guards
7272

lib/elixir/pages/Operators.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ Operator
3333

3434
Elixir provides the following built-in comparison operators:
3535

36-
* [`==`](`Kernel.==/2`) - equality
37-
* [`===`](`Kernel.===/2`) - strict equality
38-
* [`!=`](`Kernel.!=/2`) - inequality
39-
* [`!==`](`Kernel.!==/2`) - strict inequality
40-
* [`<`](`Kernel.</2`) - less than
41-
* [`>`](`Kernel.>/2`) - greater than
42-
* [`<=`](`Kernel.<=/2`) - less than or equal
43-
* [`>=`](`Kernel.>=/2`) - greater than or equal
36+
* [`==`](`==/2`) - equality
37+
* [`===`](`===/2`) - strict equality
38+
* [`!=`](`!=/2`) - inequality
39+
* [`!==`](`!==/2`) - strict inequality
40+
* [`<`](`</2`) - less than
41+
* [`>`](`>/2`) - greater than
42+
* [`<=`](`<=/2`) - less than or equal
43+
* [`>=`](`>=/2`) - greater than or equal
4444

45-
The only difference between [`==`](`Kernel.==/2`) and [`===`](`Kernel.===/2`) is that [`===`](`Kernel.===/2`) is strict when it comes to comparing integers and floats:
45+
The only difference between [`==`](`==/2`) and [`===`](`===/2`) is that [`===`](`===/2`) is strict when it comes to comparing integers and floats:
4646

4747
```elixir
4848
iex> 1 == 1.0
@@ -51,7 +51,7 @@ iex> 1 === 1.0
5151
false
5252
```
5353

54-
[`!=`](`Kernel.!=/2`) and [`!==`](`Kernel.!==/2`) act as the negation of [`==`](`Kernel.==/2`) and [`===`](`Kernel.===/2`), respectively.
54+
[`!=`](`!=/2`) and [`!==`](`!==/2`) act as the negation of [`==`](`==/2`) and [`===`](`===/2`), respectively.
5555

5656
### Term ordering
5757

0 commit comments

Comments
 (0)