Documentation for @callback?

Hello! I am wondering if there is somewhere a “documentation cheetsheet”? I am looking at Writing Documentation — Elixir v1.11.4 but I do not see a list of all available documentation attributes. I only see this sentence "such as @moduledoc, @typedoc, and @doc" but I am not knowing which options I can use or if other attributes are existing or which options they accept.

What should I use to documentation of @callback?

I am not seeing documentation for a function that implements callback. For exmaple:

defmodule Y do
  @doc """
  My documentation here
  @callback something() :: keyword()

defmodule X do
  @behaviour Y

  @impl true
  def something() do
    [a: "apple"]

However, my X module shows no functions in its documentation. This is not what I expect. ex_doc 0.24.2.

Thank you!

Just @doc will work.


Thank you hauleth! Does the above work for you? I still see no documented functions in X

I would need to check, because it have been some time since I have implemented last behaviour that required documentation in Elixir (I implement most of behaviours in Erlang).

1 Like

@behaviour is documented in the documentation for Module. The rest of the attributes are documented there as well.

1 Like

You are right. It is a bug in ExDoc

@vrod, I already filed a report callbacks implementations are not listed in the module if `@impl true` · Issue #1352 · elixir-lang/ex_doc · GitHub

Will look into into a submit a PR tonight if I can.

Actually, this behaviour comes from Elixir.

Thank you! I read the bug report and I think I understand what Jose has said.