User's Guide
Reference Manual
Release Notes
PDF
Top

EDoc
Reference Manual
Version 0.7.12

Expand All
Contract All

Table of Contents

- edoc
  - Top of manual page
  - application/1
  - application/2
  - application/3
  - file/1
  - file/2
  - files/1
  - files/2
  - get_doc/1
  - get_doc/2
  - get_doc/3
  - layout/1
  - layout/2
  - packages/1
  - packages/2
  - read/1
  - read/2
  - read_comments/1
  - read_comments/2
  - read_source/1
  - read_source/2
  - run/3
- edoc_doclet
  - Top of manual page
  - run/2
- edoc_extract
  - Top of manual page
  - file/4
  - header/3
  - header/4
  - header/5
  - source/3
  - source/4
  - source/5
  - text/4
- edoc_layout
  - Top of manual page
  - module/2
  - overview/2
  - package/2
  - type/1
- edoc_lib
  - Top of manual page
  - get_doc_env/4
  - write_file/5
- edoc_run
  - Top of manual page
  - application/1
  - file/1
  - files/1
  - packages/1

# edoc_extract

### MODULE

edoc_extract

### MODULE SUMMARY

EDoc documentation extraction.

### DESCRIPTION

EDoc documentation extraction.

### DATA TYPES

edoc_env() = edoc_env() (see module edoc_lib)
filename() = filename() (see module file)
proplist() = property() (see module proplists)
syntaxTree() = syntaxTree() (see module erl_syntax)
t() = t1()

  Some docs of t/0; Further docs of t/0. The same thing using -type: -type t() :: t1(). % Some docs of t/0; Further docs of t/0.

### EXPORTS

file(File::filename(), Context, Env::edoc_env(), Options::proplist()) -> {ok, Tags} | {error, Reason}

Types:

Context = overview | package
Tags = [term()]
Reason = term()

Reads a text file and returns the list of tags in the file. Any lines of text before the first tag are ignored. Env is an environment created by edoc_lib:get_doc_env/4. Upon error, Reason is an atom returned from the call to file:read_file/1 or the atom 'invalid_unicode'.

See text/4 for options.

header(File::filename(), Env::edoc_env(), Options::proplist()) -> {ok, Tags} | {error, Reason}

Types:

Tags = [term()]
Reason = term()

Similar to header/5, but reads the syntax tree and the comments from the specified file.

See also: header/4, edoc:read_comments/2, edoc:read_source/2.

header(Forms, File::filename(), Env::edoc_env(), Options::proplist()) -> {ok, Tags} | {error, Reason}

Types:

Forms = syntaxTree() | [syntaxTree()]
Tags = [term()]
Reason = term()

Extracts EDoc documentation from commented header file syntax trees. Similar to source/5, but ignores any documentation that occurs before a module declaration or a function definition. (Warning messages are printed if content may be ignored.) Env is assumed to already be set up with a suitable module context.

See also: erl_recomment(3), header/5.

header(Forms, Comments::[comment() (see module edoc)], File::filename(), Env::edoc_env(), Options::proplist()) -> {ok, Tags} | {error, Reason}

Types:

Forms = syntaxTree() | [syntaxTree()]
Tags = [term()]
Reason = term()

Similar to header/4, but first inserts the given comments in the syntax trees. The syntax trees must contain valid position information. (Cf. edoc:read_comments/2.)

See also: erl_recomment(3), header/3, header/4.

source(File::filename(), Env::edoc_env(), Options::proplist()) -> {ModuleName, edoc_module() (see module edoc)}

Types:

ModuleName = atom()
[term()]

Like source/5, but reads the syntax tree and the comments from the specified file.

See also: source/4, edoc:read_comments/2, edoc:read_source/2.

source(Forms, File::filename(), Env::edoc_env(), Options::proplist()) -> {ModuleName, edoc_module() (see module edoc)}

Types:

Forms = syntaxTree() | [syntaxTree()]
ModuleName = atom()

Extracts EDoc documentation from commented source code syntax trees. The given Forms must be a single syntax tree of type form_list, or a list of syntax trees representing "program forms" (cf. edoc:read_source/2. Env is an environment created by edoc_lib:get_doc_env/4. The File argument is used for error reporting and output file name generation only.

See edoc:get_doc/2 for descriptions of the def, hidden, private, and todo options.

See also: erl_recomment(3), source/5, edoc:read_comments/2, edoc:read_source/2.

source(Forms, Comments::[comment() (see module edoc)], File::filename(), Env::edoc_env(), Options::proplist()) -> {ModuleName, edoc_module() (see module edoc)}

Types:

Forms = syntaxTree() | [syntaxTree()]
ModuleName = atom()

Like source/4, but first inserts the given comments in the syntax trees. The syntax trees must contain valid position information. (Cf. edoc:read_comments/2.)

See also: erl_recomment(3), source/3, source/4, edoc:read_comments/2, edoc:read_source/2.

text(Text::string(), Context, Env::edoc_env(), Options::proplist()) -> Tags

Types:

Context = overview | package
Tags = [term()]

Returns the list of tags in the text. Any lines of text before the first tag are ignored. Env is an environment created by edoc_lib:get_doc_env/4.

See source/4 for a description of the def option.

### See also

edoc

Richard Carlsson carlsson.richard@gmail.com