Including defimpl docs in ex_doc output/doctest?

93 views
Skip to first unread message

Brian Bugh

unread,
Aug 27, 2016, 10:45:45 AM8/27/16
to elixir-lang-talk
I have a library module that implements Enumerable, which I have documented in the standard way. However, none of the docs for the protocol implementation show up (and they're not tested, either). Is there a flag I'm missing for exDoc or is this expected behavior? 

If this is expected behavior, how do people generally document protocol implementations in their documentation?

Thanks!

-Brian

José Valim

unread,
Aug 27, 2016, 11:19:19 AM8/27/16
to elixir-l...@googlegroups.com
Doctests should work as long as you doctest the implementation, such as:

doctest Enumerable.YourImpl

About the documentation, I believe implementation is not included, as the implementation is never called directly and, as such, it doesn't make much sense to document it as an API.

Brian Bugh

unread,
Aug 27, 2016, 3:11:38 PM8/27/16
to elixir-lang-talk, jose....@plataformatec.com.br
Thanks José, tjat worked! 

It seemed like the implementation of Enum needs to expose some particulars of how it's used in my use case, so I just included it in the project docs. Not a big deal. Getting the doctests working was the important bit.

Thanks for all your hard work on Elixir!

-Brian
Reply all
Reply to author
Forward
0 new messages