Table Of Contents

Previous topic

Erlang Domain

This Page

Reference

The Erlang domain (name erl) provides the following directives for module declarations. Almost all directives are similar to Python’s.

.. erl:module:: name

This directive marks the beginning of the description of a module. This directive can accept nested modules(separated by ::). It does not create content (like e.g. erl:class does).

This directive will also cause an entry in the global module index.

It has platform option, synopsis option and deprecated option as same as py:module.

.. erl:currentmodule:: name

See also

py:currentmodule

The following directives are provided for module level contents:

.. erl:function:: name(signature)

Describes a module-level function. Usage of this directive is almost as same as Python’s one.

Erlang domain can accept functions whose names are same. To identify these, Erlang domain have arity information:

.. erl:module:: lists

.. erl:function:: append(List1, List2)

   This has ``lists:append/2`` for internal name.

.. erl:function:: flatten(DeepList[, Tail]) -> List

   This has both ``lists:flatten/1`` and ``lists:flatten/2`` as
   internal name.

See also

.. py:function:: name

.. erl:macro:: name

Describes macro which typically starts with capital character.

.. erl:record:: name

Describes a record.

Cross-referencing Erlang objects

The following roles refer to objects in modules and are possibly hyperlinked if a matching identifier is found:

:erl:mod:

Reference a module.

:erl:func:

Reference a Erlang function; a name with module may be used.

It can handle arity. If you don’t pass arity, erlang domain search the function whose arity is minimum. If you don’t pass module name, it uses erlang module by default. The role text needs not include trailing parentheses to enhance readability; they will be added automatically by Sphinx if the add_function_parentheses config value is true (the default).

If you want to refer module function, you should use following style:

:erl:func:`modulename:func_name`
:erl:macro:

Reference a macro whose name starts with capital charactor.

:erl:record:

Reference a record. Typically, it starts with #.