[erlang-questions] Accessing the documentation at runtime

Loïc Hoguin <>
Wed Sep 28 20:37:07 CEST 2016

I wouldn't put this in beam files. Tying documentation to compilation 
severely limits options for input files, or makes things a lot more 
complicated at best.

I suggest separate files. One file really:


It can be loaded with the application, if present. As such it wouldn't 
be a good place to put this in code server.

On 09/28/2016 08:28 PM, Vlad Dumitrescu wrote:
> Hi,
> Following the documentation discussion, and the details about how Elixir
> supports that as API, I wonder if we could (should?) support something
> similar for Erlang.
> My suggestion for the data to store is the xml source, parsed with xmerl
> into simple-form. For non-otp modules, there is an edoclet that can
> produce opt-like xml from edoc. I don't know what format elixir uses,
> but for consuming the OTP docs this feels the easiest.
> One way is to add an optional chunk to the beam files, storing the docs.
> A new compiler option would select that, similar to 'debug'. This would
> increase the size of the files significantly and possibly only few
> people will add the docs, resulting in an useless chunk, but if it gets
> used then all data is readily available.
> An alternative would be to deliver archives with the docs in separate
> files (a zip in myapp/doc?).
> What is needed then is an API to access that, "code:get_doc(Module|App)"
> feels like it would be enough.
> Thoughts?
> best regards,
> Vlad
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions

Loïc Hoguin
Author of The Erlanger Playbook,
A book about software development using Erlang

More information about the erlang-questions mailing list