[erlang-questions] EDOC and remote type's specification

Ivan Carmenates García <>
Thu Aug 8 19:34:34 CEST 2013


Hi all,

 

I think this has to do a little with what Nikolaos Bezirgiannis was saying
about edoc generation and types,

I have this little “thing” when I was implementing a log module for a
project I am developing.

 

For example I use a remote type specification for my own function
specification like this:

 

-type log_opt() :: show | write | log.

 

%% Functions specification.

%% @doc Logs events information for the system.

%%

%% When <code>Opts</code> is:

%%

%%   <ul>

%%           <li><code>show</code> logs to the system console.</li>

%%     <li><code>write</code> logs to the solid state storage.</li>

%%     <li><code>log</code> logs to both system console and solid state
storage.</li>

%%     <li><code>error</code> logs errors to both system console and solid
state storage

%%                            in a special error format.</li>

%%   </ul>

 

-spec log_event(Opts, FormattedStr, Args) -> ok | error when

                Opts :: log_opt(),

                FormattedStr :: io:format(),

                Args :: term().

 

The one in red (io:format()) is an exported type from io module, once I
generate the documentation for the module, using edoc:file/1 in this case
this function is deprecated but I think it works for the propose, this
generate a html documentation including links for the local type log_opt()
and the remote type io:format(), the link for my own local type is well, the
problem is with the imported type (remote one), when I click the io:format()
link it of course try to find it in the working directory of my project, how
(if it’s worth) I can refer to the truly type definition in the io module
documentation?

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130808/6b3e69be/attachment.html>


More information about the erlang-questions mailing list