Skip to content

Commit 08d844a

Browse files
authored
Add and simplify links to erlang documentation (#14179)
* Link more erlang modules in docs * Fix epmd link * Use `:atom` syntax to link erlang modules
1 parent c246400 commit 08d844a

File tree

16 files changed

+27
-28
lines changed

16 files changed

+27
-28
lines changed

lib/elixir/lib/json.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ defmodule JSON do
356356
* for `string`: `&Function.identity/1`
357357
* for `null`: the atom `nil`
358358
359-
For streaming decoding, see Erlang's `:json` module.
359+
For streaming decoding, see Erlang's [`:json`](`:json`) module.
360360
"""
361361
@spec decode(binary(), term(), keyword()) ::
362362
{term(), term(), binary()} | {:error, decode_error_reason()}

lib/elixir/lib/kernel.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ defmodule Kernel do
6060
6161
* Bitstring - a sequence of bits, created with `<<>>/1`.
6262
When the number of bits is divisible by 8, they are called binaries and can
63-
be manipulated with Erlang's `:binary` module
63+
be manipulated with Erlang's [`:binary`](`:binary`) module
6464
* Reference - a unique value in the runtime system, created with `make_ref/0`
6565
6666
### Data types
@@ -5722,7 +5722,7 @@ defmodule Kernel do
57225722
>
57235723
> * If using `defoverridable`, avoid relying on `super` to trigger the default
57245724
> behaviour, suggesting users to invoke well-defined APIs instead.
5725-
>
5725+
>
57265726
"""
57275727
defmacro defoverridable(keywords_or_behaviour) do
57285728
quote do

lib/elixir/lib/map_set.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ defmodule MapSet do
4343
`MapSet`s can also be constructed starting from other collection-type data
4444
structures: for example, see `MapSet.new/1` or `Enum.into/2`.
4545
46-
`MapSet` is built on top of Erlang's
47-
[`:sets`](https://www.erlang.org/doc/man/sets.html) (version 2). This means
46+
`MapSet` is built on top of Erlang's [`:sets`](`:sets`) (version 2). This means
4847
that they share many properties, including logarithmic time complexity. Erlang
4948
`:sets` (version 2) are implemented on top of maps, so see the documentation
5049
for `Map` for more information on its execution time complexity.

lib/elixir/lib/string.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ defmodule String do
172172
Standard Annex #29](https://www.unicode.org/reports/tr29/).
173173
174174
For converting a binary to a different encoding and for Unicode
175-
normalization mechanisms, see Erlang's `:unicode` module.
175+
normalization mechanisms, see Erlang's [`:unicode`](`:unicode`) module.
176176
177177
## String and binary operations
178178

lib/elixir/pages/anti-patterns/process-anti-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ This anti-pattern has many potential remedies:
227227

228228
* If the only process that needs data is the one you are sending to, consider making the process fetch that data instead of passing it.
229229

230-
* Some abstractions, such as [`:persistent_term`](https://www.erlang.org/doc/man/persistent_term.html), allows you to share data between processes, as long as such data changes infrequently.
230+
* Some abstractions, such as [`:persistent_term`](`:persistent_term`), allows you to share data between processes, as long as such data changes infrequently.
231231

232232
In our case, limiting the input data is a reasonable strategy. If all we need *right now* is the IP address, then let's only work with that and make sure we're only passing the IP address into the closure, like so:
233233

lib/elixir/pages/getting-started/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ Finally, remember you can also get a mini-overview of the runtime info by callin
175175
176176
We have just scratched the surface of what the Erlang VM has to offer, for example:
177177
178-
* Alongside the observer application, Erlang also includes a [`:crashdump_viewer`](https://www.erlang.org/doc/man/crashdump_viewer.html) to view crash dumps
178+
* Alongside the observer application, Erlang also includes a [`:crashdump_viewer`](`:crashdump_viewer`) to view crash dumps
179179
180180
* Integration with OS level tracers, such as [Linux Trace Toolkit,](https://www.erlang.org/doc/apps/runtime_tools/lttng) [DTRACE,](https://www.erlang.org/doc/apps/runtime_tools/dtrace) and [SystemTap](https://www.erlang.org/doc/apps/runtime_tools/systemtap)
181181
182-
* [Microstate accounting](http://www.erlang.org/doc/man/msacc.html) measures how much time the runtime spends in several low-level tasks in a short time interval
182+
* [Microstate accounting](`:msacc`) measures how much time the runtime spends in several low-level tasks in a short time interval
183183
184184
* Mix ships with many tasks under the `profile` namespace, such as `mix profile.cprof` and `mix profile.fprof`
185185

lib/elixir/pages/mix-and-otp/agents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ If you have skipped the *Getting Started* guide or read it long ago, be sure to
99
Elixir is an immutable language where nothing is shared by default. If we want to share information, which can be read and modified from multiple places, we have two main options in Elixir:
1010

1111
* Using processes and message passing
12-
* [ETS (Erlang Term Storage)](http://www.erlang.org/doc/man/ets.html)
12+
* [ETS (Erlang Term Storage)](`:ets`)
1313

1414
We covered processes in the *Getting Started* guide. ETS (Erlang Term Storage) is a new topic that we will explore in later chapters. When it comes to processes though, we rarely hand-roll our own, instead we use the abstractions available in Elixir and OTP:
1515

lib/elixir/pages/mix-and-otp/distributed-tasks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The router will check the first byte of the bucket name against the table and di
1515

1616
If the matching entry points to the node evaluating the request, then we've finished routing, and this node will perform the requested operation. If the matching entry points to a different node, we'll pass the request to said node, which will look at its own routing table (which may be different from the one in the first node) and act accordingly. If no entry matches, an error will be raised.
1717

18-
> Note: we will be using two nodes in the same machine throughout this chapter. You are free to use two (or more) different machines on the same network but you need to do some prep work. First of all, you need to ensure all machines have a `~/.erlang.cookie` file with exactly the same value. Then you need to guarantee [epmd](http://www.erlang.org/doc/man/epmd.html) is running on a port that is not blocked (you can run `epmd -d` for debug info).
18+
> Note: we will be using two nodes in the same machine throughout this chapter. You are free to use two (or more) different machines on the same network but you need to do some prep work. First of all, you need to ensure all machines have a `~/.erlang.cookie` file with exactly the same value. Then you need to guarantee [epmd](https://www.erlang.org/doc/apps/erts/epmd_cmd) is running on a port that is not blocked (you can run `epmd -d` for debug info).
1919
2020
## Our first distributed code
2121

@@ -86,7 +86,7 @@ From our quick exploration, we could conclude that we should use `Node.spawn_lin
8686

8787
There are three better alternatives to `Node.spawn_link/2` that we could use in our implementation:
8888

89-
1. We could use Erlang's [:erpc](http://www.erlang.org/doc/man/erpc.html) module to execute functions on a remote node. Inside the `bar@computer-name` shell above, you can call `:erpc.call(:"foo@computer-name", Hello, :world, [])` and it will print "hello world"
89+
1. We could use Erlang's [`:erpc`](`:erpc`) module to execute functions on a remote node. Inside the `bar@computer-name` shell above, you can call `:erpc.call(:"foo@computer-name", Hello, :world, [])` and it will print "hello world"
9090

9191
2. We could have a server running on the other node and send requests to that node via the `GenServer` API. For example, you can call a server on a remote node by using `GenServer.call({name, node}, arg)` or passing the remote process PID as the first argument
9292

@@ -347,8 +347,8 @@ Distributed key-value stores, used in real-life, need to consider the fact nodes
347347
These topics can be daunting at first but remember that most Elixir frameworks abstract those concerns for you. For example, when using [the Phoenix web framework](https://phoenixframework.org), its plug-and-play abstractions take care of sending messages and tracking how users join and leave a cluster. However, if you are interested in distributed systems after all, there is much to explore. Here are some additional references:
348348

349349
* [The excellent Distribunomicon chapter from Learn You Some Erlang](http://learnyousomeerlang.com/distribunomicon)
350-
* [Erlang's global module](https://www.erlang.org/doc/man/global.html), which can provide global names and global locks, allowing unique names and unique locks in a whole cluster of machines
351-
* [Erlang's pg module](https://www.erlang.org/doc/man/pg.html), which allows process to join different groups shared across the whole cluster
350+
* Erlang's [`:global` module](`:global`), which can provide global names and global locks, allowing unique names and unique locks in a whole cluster of machines
351+
* Erlang's [`:pg` module](`:pg`), which allows process to join different groups shared across the whole cluster
352352
* [Phoenix PubSub project](https://github.com/phoenixframework/phoenix_pubsub), which provides a distributed messaging system and a distributed presence system for tracking users and processes in a cluster
353353

354354
You will also find many libraries for building distributed systems within the overall Erlang ecosystem. For now, it is time to go back to our simple distributed key-value store and learn how to configure and package it for production.

lib/elixir/pages/mix-and-otp/erlang-term-storage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ In this chapter, we will learn about ETS (Erlang Term Storage) and how to use it
88
99
## ETS as a cache
1010

11-
ETS allows us to store any Elixir term in an in-memory table. Working with ETS tables is done via [Erlang's `:ets` module](http://www.erlang.org/doc/man/ets.html):
11+
ETS allows us to store any Elixir term in an in-memory table. Working with ETS tables is done via [Erlang's `:ets` module](`:ets`):
1212

1313
```elixir
1414
iex> table = :ets.new(:buckets_registry, [:set, :protected])

lib/elixir/pages/mix-and-otp/task-and-gen-tcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Task and gen_tcp
22

3-
In this chapter, we are going to learn how to use [Erlang's `:gen_tcp` module](http://www.erlang.org/doc/man/gen_tcp.html) to serve requests. This provides a great opportunity to explore Elixir's `Task` module. In future chapters, we will expand our server so that it can actually serve the commands.
3+
In this chapter, we are going to learn how to use Erlang's [`:gen_tcp` module](`:gen_tcp`) to serve requests. This provides a great opportunity to explore Elixir's `Task` module. In future chapters, we will expand our server so that it can actually serve the commands.
44

55
## Echo server
66

0 commit comments

Comments
 (0)