CharlesIrvine
ExDoc inserting child_spec/1 into generated docs. How to suppress?
I just started using ExDoc and it is great! Just one problem so far:
When I run “mix docs” documentation is generated for the child_spec/1 function coming from using the GenServer module. That is, I have no child_spec/1 function in the module.
Is there some way to suppress this?
Marked As Solved
Qqwy
Yes! The @doc ... written immediately before the use GenServer will be attached to the child_spec/1 function that is generated. (source: the ‘how to supervise’ section of the GenServer module docs)
If you add @doc false then ExDoc won’t document a function (and won’t list it). So if you add @doc false immediately before the use GenServer line, the documentation for child_spec will be suppressed.
EDIT: However, if you do this, it might be worthwhile to at the very least document in the module docs that this is a GenServer module that can be started under a supervisor in the normal way.








