Anjoola
Anjoola

Reputation: 138

edoc not generating all documentation types in hrl file?

I currently have three files:

tempfile.hrl

-export_type([temptype/0]).
-type temptype() :: string().
%% blah blah documentation

tempfile.erl

-module(tempfile).

... more code, but no references to the temptype() type.

random.erl

-module(random).
%% @headerfile "tempfile.hrl"
-include("tempfile.hrl").

-spec random() -> tempfile:temptype().

However when using edoc, none of the documentation for temptype() appears. A hyperlink to tempfile.html#temptype appears, but it links to nowhere. I even tried to use -export_type but that didn't work... What could be the issue? Thanks.

Upvotes: 4

Views: 428

Answers (2)

aronisstav
aronisstav

Reputation: 7954

If you do want to keep the header file separate, the generic @headerfile tag can be used to import tags from an Erlang file like this:

tempfile.erl

-module(tempfile).

%%% @headerfile tempfile.hrl
... more code, but no references to the temptype() type.

Upvotes: 1

uuid0
uuid0

Reputation: 319

temptype() is not part of the module tempfile.

What you can do is to include the declaration into the tempfile module.

-export_type([temptype/0]).
-type temptype() :: string().

You don't have to have a tempfile.hrl then.

=>

tempfile.erl

-module(tempfile).
-export_type([temptype/0]).
-type temptype() :: string().

random.erl

-module(random).

-spec random() -> tempfile:temptype().

Upvotes: 1

Related Questions