-
Notifications
You must be signed in to change notification settings - Fork 1k
Lesson Styleguide
Sophie DeBenedetto edited this page Nov 26, 2018
·
6 revisions
In order to maintain consistency across all lessons and contributions, this guide defines a set of styles to be used throughout.
- Use
elixir
code blocks - Keep examples simple when possible
- Module definitions should not include the IEx prompt
- References to functions should include the arity. For example,
Enum.map/2
instead ofEnum.map
.
- Use
elixir
code blocks - Do not include line number in iex prompt (i.e.
iex>
vsiex(1)>
). This can be configured withIEx.configure(default_prompt: "%prefix>")
:
iex(2)> IEx.configure(default_prompt: "%prefix>")
:ok
iex> case :ok do
...> :ok -> "Hi"
...> _ -> "Other"
...> end
"Hi"
- Use
erlang
code blocks - Keep examples simple and to the point
- Use
number>
for shell prompt indication. For Example:
1> is_list('Example').
false
2> is_list("Example").
true
- Use
shell
code blocks - Terminal prompt character should be
$
:
$ mix deps.get
$ mix docs
- Lists should not be numbered
- Use
-
when separating a word and its definition:
+ `@moduledoc` - For module level documentation.
Please put one whitespace line before and after all markdown headers.
## An Important Section in The Lesson
Here is some important information for you.
If you're not clear on something, please feel free to open an issue with the label question.