Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Documentation of structs created with `@with_kw` from Parameters is not parsed in Pluto

Open disberd opened this issue 3 years ago • 2 comments

When creating custom structures with @with_kw from Parameters.jl, eventual docstrings that are added to the custom structure are not parsed/shown by the in-built Pluto doc helper:

image

definition with Base.@kwdef parses the documentation properly but unlike a standard struct definition, the docstring is not sent as output to the cell where the custom struct is defined (The struct name is simply shown in the output like TEST2 in the image above)

disberd avatar Nov 15 '21 09:11 disberd

I had this problem too, workaround was:

begin
Base.@kwdef struct Hello
	world=123
end

@doc """
My cool struct!

asdf
""" Hello
end

(from https://github.com/JuliaPluto/PlutoUI.jl/blob/9eb6f719873780a00fe43138b8afb787d2066621/src/Builtins.jl#L437-L469 )

fonsp avatar Nov 15 '21 12:11 fonsp

Ideally we'd be parsing the actual docstring/definition from the (macro expanded) code, that's on the todo list somewhere.

dralletje avatar Nov 15 '21 20:11 dralletje