Chapter 16. EDoc comments

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

16.1. Writing EDoc comments

The EDoc user guide explains everything you need to know about EDoc comments.

16.2. Configuration

The EDOC_OPTS variable allows you to specify additional EDoc options. Options are documented in the EDoc manual.

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

DOC_DEPS = edown
EDOC_OPTS = {doclet, edown_doclet}

16.3. Usage

To build all documentation, you would typically use:

$ 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:

$ make edoc

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

docs:: edoc

16.4. 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:

EDOC_SRC_DIRS = $(ALL_APPS_DIRS)