Question

My question

How do I generate OTP-like documentation for multiple applications?

Explanation

I have developed an application library following the OTP structure, and I'm using rebar to compile the code.

An example of my directory structure is shown below:

lib/
   apps/
      application_1/
         include/
         src/
      application_2/
         include/
         src/
      ...
   rebar.config
   rebar

My rebar.config file looks like the one below:

{sub_dirs, ["apps/application_1",
            "apps/application_2",
            ...]}.

When I run rebar doc, the documentation is generated and stored in the doc folder inside each application directory, but I want to generate a documentation that understands the library folder as one single unit. In other words, I want to create an index page automatically, just like the Erlang documentation.

I tried understanding erl_docgen, but to no avail. Is there a way to do this?

Was it helpful?

Solution

In the case of OTP, the documentation you find at http://erlang.org/doc seems to be generated using a bunch of HTML templates, scripts and Makefiles. See:

https://github.com/erlang/otp/tree/maint/system/doc/top

You might want to use that as an "inspiration" for your own documentation top pages.

I'm not sure if rebar can create a documentation index for all the Erlang applications contained in an Erlang release, but I doubt it.

OTHER TIPS

medoc (for multiple-edoc), is a rebar3 plugin I wrote that will put all the docs into the same top level doc directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top