O'Reilly logo

Programming Elixir by Dave Thomas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Task: Create Project Documentation

Java has Javadoc, Ruby has RDoc, and Elixir has ExDoc—a documentation tool that describes your project, showing the modules, the things defined in them, and any documentation you’ve written for them.

Using it is easy. First, add the ExDoc dependency to your mix.exs file. This dependency is unique—rather than drag it in from hex.pm, we’ll get it from GitHub.

project/5/issues/mix.exs
 
defp​ deps ​do
 
[
 
{ :httpoison, ​"~> 0.4"​ },
 
{ :jsx, ​"~> 2.0"​ },
 
{ :ex_doc, github: ​"elixir-lang/ex_doc"​ }
 
]
 
end

While you’re in the mix.exs, you can add a project name and (if your project is in GitHub) a URL. The latter allows ExDoc to provide live links to your source code. These parameters go in the project ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required