Skip to content
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.

Elixir Code

  • 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 of Enum.map.

IEx Output

  • Use elixir code blocks
  • Do not include line number in iex prompt (i.e. iex> vs iex(1)>). This can be configured with IEx.configure(default_prompt: "%prefix>"):
iex(2)> IEx.configure(default_prompt: "%prefix>")
:ok
iex> case :ok do
...> :ok -> "Hi"
...> _ -> "Other"
...> end
"Hi"

Erlang & EShell Examples

  • 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

Terminal Output

  • Use shell code blocks
  • Terminal prompt character should be $:
$ mix deps.get
$ mix docs

Lists

  • Lists should not be numbered
  • Use - when separating a word and its definition:
+ `@moduledoc` - For module level documentation.

Formatting Headers

Please put one whitespace line before and after all markdown headers.

## An Important Section in The Lesson 

Here is some important information for you.

Not sure?

If you're not clear on something, please feel free to open an issue with the label question.