How to disable doc generating for type definitions in Elixir?

169 Views Asked by At

For example I have a module like

defmodule Foo do
  @type bar :: string
end

But I don't want to generate doc for bar because it's meant to use internal implementation.

2

There are 2 best solutions below

0
On BEST ANSWER

There's @typedoc for types like @doc for functions, but unlike @doc false, @typedoc false doesn't seem to hide the type from the documentation. Since this is for internal use, I'm assuming you don't want to export it out of the module either, so you can use @typep to declare it private, which will also remove it from the documentation:

defmodule Foo do
  @typep bar :: string
end
2
On

I believe that you can use the flag

@doc false

on top of the code you dont want docs for. As shown in the docs: enter image description here