I want to document a callable, parametric struct, but the docstring for the function does not show up.
This question is similar to Documenting a functor / callable struct, but the fix (https://github.com/JuliaLang/julia/pull/25626) does not seem to work for parametric callable structs.
"""Docs for Parametric struct """
struct Parametric{T} end
"""Docs for Parametric func"""
function (f::Parametric{T})(x) where {T} end
"""Docs for NonParametric struct """
struct NonParametric end
"""Docs for NonParametric func"""
function (f::NonParametric)(x) end
@doc Parametric
@doc NonParametric
Output:
julia> @doc Parametric
Docs for Parametric struct
julia> @doc Parametric{Int}
Docs for Parametric struct
julia> @doc NonParametric
Docs for NonParametric struct
Docs for NonParametric func