Skip to content

Commit

Permalink
Update "Using ExDoc with Erlang projects" guide (#1379)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored Jul 5, 2021
1 parent 013dd4a commit 96dbd24
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ To use ExDoc with Erlang projects you need to do the following:
$ mix escript.install github elixir-lang/ex_doc
$ ex_doc --version
```

Make sure escript is in your system path, otherwise point to it directly.

4. Generate docs:
Expand All @@ -153,7 +153,7 @@ To use ExDoc with Erlang projects you need to do the following:
$ ex_doc "PROJECT_NAME" "PROJECT_VERSION" _build/default/lib/<app>/ebin
```

5. If you're publishing docs to Hex.pm with `rebar3 hex docs`, first add the following to your `src/<app>.app.src`:
5. If you're publishing docs to Hex.pm, first add the following to your `src/<app>.app.src`:
```erlang
{doc, "doc"}
Expand All @@ -167,6 +167,15 @@ To use ExDoc with Erlang projects you need to do the following:
$ rebar3 hex docs
```

6. If your project has dependencies and you want to generate links to them, you need to add the dependencies to the code path.

Suppose you're building `foo` that depends on `bar` and `baz`. Generate the docs with:
```bash
$ ex_doc "foo" "1.0.0" "_build/default/lib/foo/ebin" \
--paths "_build/default/lib/*/ebin"
```
## Auto-linking
ExDoc will automatically generate links across modules and functions if you enclose them in backticks:
Expand Down

0 comments on commit 96dbd24

Please sign in to comment.