rebar3_ex_doc - A rebar3 plugin for generating documentation using ex_doc
This plugin uses edoc to generate doc chunks and ex_doc to craft both html and epub outputs.
It should be duly noted that this functionality is thanks to many peoples efforts around EEP-48 and not the plugin.
In the EEF build and packaging working group we have been planning to make said functionality, which has existed for a while now, available via a rebar3 plugin.
rebar3_ex_doc makes it easy to get up and going. Perhaps more importantly, it serves as a doc provider for rebar3_hex, which further paves the way towards a more consistent documentation format and style for erlang packages on hex.pm.
The configuration required to get going is extremely minimal, you can read about it in the docs.
I tried this on an umbrella codebase and it struggled due to modules with an explicit include path to another application. I’m not at work, but I’ll try to give an example:
This is a great find! I can replicate this in rebar3_ex_doc but more importantly using edoc as well. It seems to be around when {preprocess, true} is set.
Fixed a bug that prevented generating docs on windows thanks to cw789 for raising the issue and testing the patch (this was actually released in 0.2.4, but noting here).
Fixed a bug where by we were not passing the package name to ex_doc
Fixed a bug where by edoc opts along with ex_doc_opts might cause beam chunks to not be emitted (this was actually fixed in 0.2.3, but noting here). Thanks to @Taure for raising the issue.
Release 0.2.7 seems broken, it doesn’t contain priv/ex_doc anymore and the changelog has an [Unreleased] entry instead of [0.2.7]. Did you publish this one accidentally?
@starbelly I understand that it uses the same tags as edoc.
is there a way to document types and callbacks?
I was reading edoc chapter, and didn’t find anything about it.
-module(mylib).
-type a() :: {a, 2}. %% So I want to document stuff,
%% and I want it to be multi-line.
%%
%% Right?
-export_type([a/0]).
-type b() :: {b, 2}. %% How should I do it?
%%
%% Can you help?
-export_type([b/0]).
-export([a/0, b/0]).
%% @doc Would this work?
-spec a() -> ok.
a() ->
ok.
%% @doc What's this about?
%%
%% e.g. with multi-line
-spec b() -> not_me.
b() ->
not_me.