ExDoc
Mix.install([
{:jason, "~> 1.4"},
{:kino, "~> 0.9", override: true},
{:youtube, github: "brooklinjazz/youtube"},
{:hidden_cell, github: "brooklinjazz/hidden_cell"}
])
Navigation
Home Report An Issue TypespecsCredoExDoc
ExDoc takes the documentation we define in our project using @moduledoc and @doc and generates the same documentation we’ve see on HexDocs.
To add ExDoc to a mix project, we install it in our list of dependencies in mix.exs. The latest version is on hex.pm. We only need documentation for the :dev environment, and we do not need it during runtime.
defp deps do
[
{:ex_doc, "~> 0.28", only: :dev, runtime: false}
]
end
Install dependencies.
$ mix deps.get
Then generate documentation for the project.
$ mix docs
This creates a docs/ folder. Inside the docs folder is an index.html file.
HTML stands for hyper-text-markup-language. It’s the code used to structure a web page and its content.
You can open the docs/index.html file in your browser to view the project documentation.
Your Turn
Previously you converted a Math module into a mix project in the ExUnit with Mix section.
Add ExDoc to your Math project. When finished, Open the index.html file in your browser, and you should see a page similar to the following.
Commit Your Progress
DockYard Academy now recommends you use the latest Release rather than forking or cloning our repository.
Run git status to ensure there are no undesirable changes.
Then run the following in your command line from the curriculum folder to commit your progress.
$ git add .
$ git commit -m "finish ExDoc reading"
$ git push
We’re proud to offer our open-source curriculum free of charge for anyone to learn from at their own pace.
We also offer a paid course where you can learn from an instructor alongside a cohort of your peers. We will accept applications for the June-August 2023 cohort soon.