No description or website provided.
Elixir
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
lib
test
.gitignore
README.md
mix.exs
mix.lock

README.md

Elixir documentation examples

Inline comments

defmodule Maths do
  def add(left, right) do
    # Add two numbers together
    left + right
  en
end

Module documentation

defmodule Maths do
  @moduledoc """
  A module that implements functions for performing simple
  mathematic calculations
  """

  def add(left, right) do
    # Add two numbers together
    left + right
  end
end

Function documentation

defmodule Maths do
  @moduledoc """
  A module that implements functions for performing simple
  mathematic calculations
  """

  @doc """
  Add two numbers together
  """
  def add(left, right) do
    # Add two numbers together
    left + right
  end
end

Testing your documentation

@doc """
Add two numbers together

Examples

    iex> Maths.add(4, 2)
    5
"""
def add(left, right) do
  # Add two numbers together
  left + right
end