Skip to content

Commit 45078a2

Browse files
committed
Cleanup documentation
1 parent f8f0486 commit 45078a2

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ call, depending on the context where it was used.
99

1010
## Installation
1111

12-
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
13-
by adding `ex_const` to your list of dependencies in `mix.exs`:
12+
The package can be installed by adding `ex_const` to your list of dependencies
13+
in `mix.exs`:
1414

1515
```elixir
1616
def deps do
@@ -106,16 +106,18 @@ Or with the expanded syntax:
106106
end
107107

108108
e.g.
109-
110-
enum country_code, do: [argentina: "AR", italy: "IT", usa: "US"]
109+
```elixir
110+
enum country_code, do: [argentina: "AR", italy: "IT", usa: "US"]
111+
```
111112

112113
Or:
113-
114-
enum country_code do
115-
argentina "AR"
116-
italy "IT"
117-
usa "US"
118-
end
114+
```elixir
115+
enum country_code do
116+
argentina "AR"
117+
italy "IT"
118+
usa "US"
119+
end
120+
```
119121

120122
For each `enum` instance, the macro will create the following additional macros
121123
and functions in the module where it was invoked:
@@ -131,10 +133,11 @@ and functions in the module where it was invoked:
131133
`enum` will be used and the other ones will be disregarded.
132134

133135
e.g.
134-
135-
defmacro country_code(atom) :: String.t
136-
def country_code_enum(atom) :: String.t
137-
def from_country_code(String.t) :: atom
136+
```elixir
137+
defmacro country_code(atom) :: String.t
138+
def country_code_enum(atom) :: String.t
139+
def from_country_code(String.t) :: atom
140+
```
138141

139142
The enumerated values can be accessed with a function call:
140143

0 commit comments

Comments
 (0)