Sujan Kumar Sakthi
Sujan Kumar Sakthi

Reputation: 423

How to generate document for Ejabberd custom modules?

I have created some custom modules I need to create documentation for all my custom module So any help?

Upvotes: 0

Views: 62

Answers (1)

vkatsuba
vkatsuba

Reputation: 1449

You can use edoc - http://erlang.org/doc/apps/edoc/chapter.html. Eg: test_edoc.erl

-module(test_edoc).

-export([run/1]).

%% -------------------------------------------------------------------
%% @doc
%% Some description
%% @end
%% -------------------------------------------------------------------
-spec run(N :: integer()) -> Result :: integer() | error.

run(N) when is_integer(N) -> N + 1;
run(_) -> error.

Then in Erlang shell:

1> edoc:files(["test_edoc.erl"], [{dir, doc}]).
ok

Then in current folder where you run edoc:files/2 should be generated the doc folder, so, go to the doc folder and open in browser test_edoc.html

Upvotes: 1

Related Questions