From 96dbd249762976a5107d5dc9df319fdc04eea369 Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Mon, 5 Jul 2021 12:16:41 +0200 Subject: [PATCH] Update "Using ExDoc with Erlang projects" guide (#1379) --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 179836339..851e7d571 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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//ebin ``` -5. If you're publishing docs to Hex.pm with `rebar3 hex docs`, first add the following to your `src/.app.src`: +5. If you're publishing docs to Hex.pm, first add the following to your `src/.app.src`: ```erlang {doc, "doc"} @@ -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: