<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 28, 2016 at 9:44 PM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Regarding an API<br>
<br>
It is not a coincidence that the HTML documentation for (say<br>
lists.erl) can be obtained by fetching the page<br>
<a href="http://erlang.org/doc/man/lists.html" rel="noreferrer" target="_blank">http://erlang.org/doc/man/list<wbr>s.html</a><br>
<br>
How about a REST interface to extract the parts of the documentation?<br>
<br>
For example<br>
<br>
<a href="http://erlang.org/doc/man/lists?type=xml" rel="noreferrer" target="_blank">http://erlang.org/doc/man/lis<wbr>ts?type=xml</a><br>
would fetch the lists.xml (the documentation)<br>
<br>
<a href="http://erlang.org/doc/man/lists?type=erl" rel="noreferrer" target="_blank">http://erlang.org/doc/man/lis<wbr>ts?type=erl</a><br>
(the code)<br>
<br>
and<br>
<a href="http://erlang.org/doc/man/lists?type=xml&func=append&arity=2" rel="noreferrer" target="_blank">http://erlang.org/doc/man/list<wbr>s?type=xml&func=append&arity=2</a><br>
would fetch the documentation for lists:append/2 etc.<br></blockquote><div> </div><div>From other comments on the documentation thread, there are many people that work offline, so accessing the documentation via internet is not useful. Even so, I would like to cache it locally, so it could be saved in an archive just as we said before. </div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If we *standardise* the interface then writing tools to present this in<br>different ways should possible<br></blockquote></div><div><br></div><div>We can standardise it just as well as to accessing the local file, how it gets there is another issue. Maybe it was downloaded, maybe it was installed, maybe it was built. </div><div><br></div><div>BTW, we also want to make sure that we use the documentation matching the current version of the module, so we need the module's version attribute as key.</div><div><br></div><div>regards,<br></div><div>Vlad</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
<br>
On Wed, Sep 28, 2016 at 8:28 PM, Vlad Dumitrescu <<a href="mailto:vladdu55@gmail.com" target="_blank">vladdu55@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> Following the documentation discussion, and the details about how Elixir<br>
> supports that as API, I wonder if we could (should?) support something<br>
> similar for Erlang.<br>
><br>
> My suggestion for the data to store is the xml source, parsed with xmerl<br>
> into simple-form. For non-otp modules, there is an edoclet that can produce<br>
> opt-like xml from edoc. I don't know what format elixir uses, but for<br>
> consuming the OTP docs this feels the easiest.<br>
><br>
> One way is to add an optional chunk to the beam files, storing the docs. A<br>
> new compiler option would select that, similar to 'debug'. This would<br>
> increase the size of the files significantly and possibly only few people<br>
> will add the docs, resulting in an useless chunk, but if it gets used then<br>
> all data is readily available.<br>
><br>
> An alternative would be to deliver archives with the docs in separate files<br>
> (a zip in myapp/doc?).<br>
><br>
> What is needed then is an API to access that, "code:get_doc(Module|App)"<br>
> feels like it would be enough.<br>
><br>
> Thoughts?<br>
><br>
> best regards,<br>
> Vlad<br>
><br>
><br>
</div></div><span>> ______________________________<wbr>_________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
</span>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
><br>
</blockquote></div><br></div></div>