To generate documentation from @doc and @moduledoc attributes in your source code, add ex_doc and a markdown processor as dependencies into your mix.exs file:

# config/mix.exs

def deps do
  [{:ex_doc, "~> 0.11", only: :dev}]
end

You can use Markdown within Elixir @doc and @moduledoc attributes.

Then, run mix deps.get to fetch and compile the new modules and generate the project documentation with mix docs. An example output is the official Elixir Docs.

Additional reading: