erlef / documentation-wg

EEF Documentation Working Group
9 stars 1 forks source link

Generate ExDoc documentation for Erlang projects #4

Open erszcz opened 4 years ago

erszcz commented 4 years ago

This thread documents the progress on generating ExDoc documentation for Erlang projects.

Current status

erszcz/edoc@0c81cea1b659ad9fd00993d25c9de9293c3651b0 can be used to generate chunks compatible with erlang/otp@dd3b0157d2b20adacd98fea64b3af443b6639b9a as follows:

git clone https://github.com/ferd/recon
cd recon
cat >> rebar.config <<END

{plugins,
 [
  {rebar3_edoc_chunks, {git, "https://github.com/erszcz/edoc.git", {branch, "master"}}}
 ]}.

{provider_hooks,
 [
  {post, [{compile, {edoc_chunks, compile}}]}
 ]}.
END
rebar3 compile
ls _build/default/lib/recon/doc/chunks/

ToDo

2020-04-01 update:

jfacorro commented 4 years ago

Hi 👋 ! This looks like a great idea, I was wondering what is the current status of this effort.

I was also curious about how would an Erlang project use ExDoc in a purely Erlang context (i.e. Elixir is not installed). I guess Elixir would be required in that case, am I correct?

josevalim commented 4 years ago

We are working on it. At the moment, we are refactoring ExDoc so it can support multiple sources (Elixir's markdown and Erlang's doc AST).

I was also curious about how would an Erlang project use ExDoc in a purely Erlang context (i.e. Elixir is not installed).

It will be done with escripts - so Elixir, ExDoc, and everything else will be in a single file executable.

erszcz commented 4 years ago

Hi, @jfacorro!

On the EDoc side of things the remaining big thing is to support linking. The progress has been slow lately due to the summer period and the pandemic before that, but I'm now hoping to get up to speed again.

BTW, funny things are exposed when trying to fill in the chunk fields with what we can get from EDoc - for example, @since or @deprecated were never supported on types, whereas prior to this effort callbacks could not have attached doc comments at all 🤷

erszcz commented 4 years ago

FYI, the PR for the EDoc side of things is now ready - https://github.com/erlang/otp/pull/2803.