aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide/edoc.asciidoc
blob: 2992a37d91cde371e3becc30bb546efe58f55515 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[[edoc]]
== EDoc comments

Erlang.mk provides a thin wrapper on top of EDoc, an application
that generates documentation based on comments found in modules.

=== Writing EDoc comments

The http://www.erlang.org/doc/apps/edoc/chapter.html[EDoc user guide]
explains everything you need to know about EDoc comments.

=== Configuration

The `EDOC_OPTS` variable allows you to specify additional
EDoc options. Options are documented in the
http://www.erlang.org/doc/man/edoc.html#run-2[EDoc manual].

A common use for this variable is to enable Markdown in doc
comments, using the `edown` application:

[source,make]
DOC_DEPS = edown
EDOC_OPTS = {doclet, edown_doclet}

=== Usage

To build all documentation, you would typically use:

[source,bash]
$ make docs

Do note, however, that EDoc comments will only be generated
automatically if the 'doc/overview.edoc' file exists. If you
do not want that file and still want to generate doc comments,
two solutions are available.

You can generate EDoc documentation directly:

[source,bash]
$ make edoc

You can enable automatic generation on `make docs` by adding
the following to your Makefile:

[source,make]
----
docs:: edoc
----

=== Running EDoc on all applications

In a multi-application project you may want to run EDoc
against all applications at the same time, instead of
against each applications independently. To do so, you
need to configure the `EDOC_SRC_DIRS` at the end of
your Makefile, after including 'erlang.mk':

[source,make]
----
EDOC_SRC_DIRS = $(ALL_APPS_DIRS)
----