Skip to content

Commit ec9d6a7

Browse files
committed
Caps and code block language hint
1 parent 4cc3970 commit ec9d6a7

11 files changed

+23
-23
lines changed

getting-started/basic-types.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ iex> {1, 2, 3} # tuple
2323

2424
## Basic arithmetic
2525

26-
Open up `iex` and type the following expressions:
26+
Open up `iex` and type the following expressions:
2727

2828
```iex
2929
iex> 1 + 2
@@ -135,7 +135,7 @@ iex> "hellö"
135135
"hellö"
136136
```
137137

138-
> Note: if you are running on Windows, there is a chance your terminal does not use UTF-8 by default. You can change the encoding of your current session by running `chcp 65001` before entering iex.
138+
> Note: if you are running on Windows, there is a chance your terminal does not use UTF-8 by default. You can change the encoding of your current session by running `chcp 65001` before entering IEx.
139139
140140
Elixir also supports string interpolation:
141141

getting-started/binaries-strings-and-char-lists.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ iex> String.length string
3838
5
3939
```
4040

41-
> Note: if you are running on Windows, there is a chance your terminal does not use UTF-8 by default. You can change the encoding of your current session by running `chcp 65001` before entering iex.
41+
> Note: if you are running on Windows, there is a chance your terminal does not use UTF-8 by default. You can change the encoding of your current session by running `chcp 65001` before entering `iex`.
4242
4343
UTF-8 requires one byte to represent the code points `h`, `e` and `o`, but two bytes to represent `ł`. In Elixir, you can get a code point's value by using `?`:
4444

@@ -168,7 +168,7 @@ iex> 'hello'
168168
'hello'
169169
```
170170

171-
You can see that, instead of containing bytes, a char list contains the code points of the characters between single-quotes (note that iex will only output code points if any of the chars is outside the ASCII range). So while double-quotes represent a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
171+
You can see that, instead of containing bytes, a char list contains the code points of the characters between single-quotes (note that IEx will only output code points if any of the chars is outside the ASCII range). So while double-quotes represent a string (i.e. a binary), single-quotes represents a char list (i.e. a list).
172172

173173
In practice, char lists are used mostly when interfacing with Erlang, in particular old libraries that do not accept binaries as arguments. You can convert a char list to a string and back by using the `to_string/1` and `to_char_list/1` functions:
174174

getting-started/case-cond-and-if.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ iex> case :ok do
122122

123123
Note anonymous functions can also have multiple clauses and guards:
124124

125-
```elixir
125+
```iex
126126
iex> f = fn
127127
...> x, y when x > 0 -> x + y
128128
...> x, y -> x * y

getting-started/introduction.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ When you install Elixir, you will have three new executables: `iex`, `elixir` an
3131

3232
For now, let's start by running `iex` (or `iex.bat` if you are on Windows) which stands for Interactive Elixir. In interactive mode, we can type any Elixir expression and get its result. Let's warm up with some basic expressions.
3333

34-
Open up `iex` and type the following expressions:
34+
Open up `iex` and type the following expressions:
3535

3636
```iex
3737
Interactive Elixir - press Ctrl+C to exit (type h() ENTER for help)

getting-started/meta/macros.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Elixir also supports private macros via `defmacrop`. As private functions, these
227227

228228
It is important that a macro is defined before its usage. Failing to define a macro before its invocation will raise an error at runtime, since the macro won't be expanded and will be translated to a function call:
229229

230-
```elixir
230+
```iex
231231
iex> defmodule Sample do
232232
...> def four, do: two + two
233233
...> defmacrop two, do: 2

getting-started/mix-otp/dependencies-and-umbrella-apps.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def deps do
4646
end
4747
```
4848

49-
This dependency refers to the latest version of plug in the 0.5.x version series that has been pushed to Hex. This is indicated by the `~>` preceding the version number. For more information on specifying version requirements, see the [documentation for the Version module](/docs/stable/elixir/#!Version.html).
49+
This dependency refers to the latest version of Plug in the 0.5.x version series that has been pushed to Hex. This is indicated by the `~>` preceding the version number. For more information on specifying version requirements, see the [documentation for the Version module](/docs/stable/elixir/#!Version.html).
5050

5151
Typically, stable releases are pushed to Hex. If you want to depend on an external dependency still in development, Mix is able to manage git dependencies, too:
5252

@@ -94,7 +94,7 @@ However, if you push every application as a separate project to a git repository
9494

9595
For this reason, Mix supports "umbrella projects." Umbrella projects allow you to create one project that hosts many applications and push all of them to a single git repository. That is exactly the style we are going to explore in the next sections.
9696

97-
What we are going to do is create a new mix project. We are going to creatively name it `kv_umbrella`, and this new project will have both the existing `kv` application and the new `kv_server` application inside. The directory structure will look like this:
97+
What we are going to do is create a new Mix project. We are going to creatively name it `kv_umbrella`, and this new project will have both the existing `kv` application and the new `kv_server` application inside. The directory structure will look like this:
9898

9999
+ kv_umbrella
100100
+ apps

getting-started/mix-otp/genevent.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ There are two events we are going to emit: one for every time a bucket is added
1616

1717
Let's start a new `iex -S mix` session and explore the GenEvent API a bit:
1818

19-
```elixir
19+
```iex
2020
iex> {:ok, manager} = GenEvent.start_link
2121
{:ok, #PID<0.83.0>}
2222
iex> GenEvent.sync_notify(manager, :hello)
@@ -190,7 +190,7 @@ Run the test suite, and all tests should be green again.
190190

191191
One last functionality worth exploring from `GenEvent` is the ability to consume its events as a stream:
192192

193-
```elixir
193+
```iex
194194
iex> {:ok, manager} = GenEvent.start_link
195195
{:ok, #PID<0.83.0>}
196196
iex> spawn_link fn ->

getting-started/mix-otp/introduction-to-mix.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ In this chapter, we will create our first project using Mix and explore differen
4848

4949
When you install Elixir, besides getting the `elixir`, `elixirc` and `iex` executables, you also get an executable Elixir script named `mix`.
5050

51-
Let's create our first project by invoking `mix new` from the command line. We'll pass the project name as argument (`kv`, in this case), and tell mix that our main module should be the all-uppercase `KV`, instead of the default, which would have been `Kv`:
51+
Let's create our first project by invoking `mix new` from the command line. We'll pass the project name as argument (`kv`, in this case), and tell Mix that our main module should be the all-uppercase `KV`, instead of the default, which would have been `Kv`:
5252

5353
```bash
5454
$ mix new kv --module KV
@@ -69,7 +69,7 @@ Mix will create a directory named `kv` with a few files in it:
6969

7070
Let's take a brief look at those generated files.
7171

72-
> Note: Mix is an Elixir executable. This means that in order to run `mix`, you need to have elixir's executable in your PATH. If not, you can run it by passing the script as argument to elixir:
72+
> Note: Mix is an Elixir executable. This means that in order to run `mix`, you need to have Elixir's executable in your PATH. If not, you can run it by passing the script as argument to `elixir`:
7373
>
7474
> ```bash
7575
> $ bin/elixir bin/mix new kv --module KV
@@ -81,7 +81,7 @@ Let's take a brief look at those generated files.
8181
> $ bin/elixir -S mix new kv --module KV
8282
> ```
8383
>
84-
> When using -S, elixir finds the script wherever it is in your PATH and executes it.
84+
> When using -S, `elixir` finds the script wherever it is in your PATH and executes it.
8585
8686
## Project compilation
8787
@@ -215,7 +215,7 @@ Finally, the stacktrace relates to the failure itself, giving information about
215215

216216
Mix supports the concept of "environments". They allow a developer to customize compilation and other options for specific scenarios. By default, Mix understands three environments:
217217

218-
* `:dev` - the one in which mix tasks (like `compile`) run by default
218+
* `:dev` - the one in which Mix tasks (like `compile`) run by default
219219
* `:test` - used by `mix test`
220220
* `:prod` - the one you will use to put your project in production
221221

getting-started/mix-otp/supervisor-and-application.markdown

+5-5
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ Oops, it's already started. Mix normally starts the whole hierarchy of applicati
106106

107107
We can pass an option to Mix to ask it to not start our application. Let's give it a try by running `iex -S mix run --no-start`:
108108

109-
```elixir
109+
```iex
110110
iex> Application.start(:kv)
111111
:ok
112112
```
113113

114114
We can stop our `:kv` application as well as the `:logger` application, which is started by default with Elixir:
115115

116-
```elixir
116+
```iex
117117
iex> Application.stop(:kv)
118118
:ok
119119
iex> Application.stop(:logger)
@@ -122,21 +122,21 @@ iex> Application.stop(:logger)
122122

123123
And let's try to start our application again:
124124

125-
```elixir
125+
```iex
126126
iex> Application.start(:kv)
127127
{:error, {:not_started, :logger}}
128128
```
129129

130130
Now we get an error because an application that `:kv` depends on (`:logger` in this case) isn't started. We need to either start each application manually in the correct order or call `Application.ensure_all_started` as follows:
131131

132-
```elixir
132+
```iex
133133
iex> Application.ensure_all_started(:kv)
134134
{:ok, [:logger, :kv]}
135135
```
136136

137137
Nothing really exciting happens but it shows how we can control our application.
138138

139-
> When you run `iex -S mix`, it is equivalent to running `iex -S mix run`. So whenever you need to pass more options to Mix when starting iex, it's just a matter of typing `iex -S mix run` and then passing any options the `run` command accepts. You can find more information about `run` by running `mix help run` in your shell.
139+
> When you run `iex -S mix`, it is equivalent to running `iex -S mix run`. So whenever you need to pass more options to Mix when starting IEx, it's just a matter of typing `iex -S mix run` and then passing any options the `run` command accepts. You can find more information about `run` by running `mix help run` in your shell.
140140
141141
### The application callback
142142

getting-started/mix-otp/task-and-gen-tcp.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ The `read_line/1` implementation receives data from the socket using `:gen_tcp.r
9292

9393
This is pretty much all we need to implement our echo server. Let's give it a try!
9494

95-
Start an iex session inside the `kv_server` application with `iex -S mix`. Inside IEx, run:
95+
Start an IEx session inside the `kv_server` application with `iex -S mix`. Inside IEx, run:
9696

97-
```elixir
97+
```iex
9898
iex> KVServer.accept(4040)
9999
```
100100

getting-started/sigils.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ iex> ~w(foo bar bat)a
9696

9797
Besides lowercase sigils, Elixir supports uppercase sigils to deal with escaping characters and interpolation. While both `~s` and `~S` will return strings, the former allows escape codes and interpolation while the latter does not:
9898

99-
```elixir
99+
```iex
100100
iex> ~s(String with escape codes \x26 #{"inter" <> "polation"})
101101
"String with escape codes & interpolation"
102102
iex> ~S(String without escape codes and without #{interpolation})

0 commit comments

Comments
 (0)