[erlang-questions] eDoc picking up -spec and -type; when?

Ulf Wiger ulf.wiger@REDACTED
Wed Oct 27 09:58:27 CEST 2010


Hi Hans,

Since you're working on EDoc... :)

While playing with my edown extension to EDoc (where I also had some issues
with the imperative nature and implicit assumptions in the plugin framework,
but that's OT), I thought a bit about how EDoc handles external references.

The small initial test case I had was the docs in edown_doclet.erl [1], which 
is basically copied from edoc_doclet.erl. I noticed that the link references
e.g. {@link //edoc/edoc:layout/2} didn't expand to a usable (online) link.

By default, edoc finds the local copy of the app and inserts the file path,
but it also provides an option {app_default, URI} for other targets.

I thought the reasonable configuration would be something like:

{edoc_opts, [{doclet, edown_doclet},
	     {app_default,"http://www.erlang.org/doc/man"}]}.

...in rebar.config

This changes the link, but to 

http://www.erlang.org/doc/man/edoc/doc/edoc.html#layout-2

The "edoc/doc/ path is something edoc inserts. The correct link
should be

http://www.erlang.org/doc/man/edoc_doclet.html#layout-2

One can spend significant time with the edoc docs without grasping
how to get edoc to correctly reference the online OTP man pages.

Is there some obvious trick that I'm missing?

There are some other options, where edoc can be instructed to fetch
edoc-info files, but I'd rather have something that can be statically 
resolved.

BR,
Ulf W


[1] http://github.com/esl/edown/blob/master/doc/edown_doclet.md

On 27 Oct 2010, at 09:26, Hans Bolinder wrote:

> [Logan, Martin:]
>> Can anyone tell me when eDoc will start to pick up specs?
> 
> The work in on-going but interrupted from time to time by other tasks.
> 
> There is a chance that a working version will be finished before
> R14B01, but R14B02 is more likely.
> 
> The latest version can be found at http://github.com/uabboli/EDoc. It
> is not stable, but as long as one is aware of that, it can be used for
> testing.
> 
> A typical invocation that activates the new features:
> 
>  edoc:files([File], [{dialyzer_specs,all},{report_missing_type,true},
>                      {report_type_mismatch,true},{pretty_print,erl_pp},
>                      {preprocess,true}]).
> 
> Best regards,
> 
> Hans Bolinder, Erlang/OTP team, Ericsson
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
> 

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com





More information about the erlang-questions mailing list