Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 2.46 KB

exdoc.livemd

File metadata and controls

79 lines (52 loc) · 2.46 KB

ExDoc

Mix.install([
  {:youtube, github: "brooklinjazz/youtube"},
  {:hidden_cell, github: "brooklinjazz/hidden_cell"},
  {:tested_cell, github: "brooklinjazz/tested_cell"},
  {:utils, path: "#{__DIR__}/../utils"}
])

Navigation

Return Home Report An Issue

Setup

Ensure you type the ea keyboard shortcut to evaluate all Elixir cells before starting. Alternatively you can evaluate the Elixir cells as you read.

ExDoc

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

Run the following in your command line from the beta_curriculum folder to track and save your progress in a Git commit.

$ git add .
$ git commit -m "finish exdoc section"

Up Next

Previous Next
Typespecs Credo