Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
disberd opened this issue Nov 15, 2021 · 2 comments
Labels
macro Julia macros: @oops other packages Integration with other Julia packages

Comments

@disberd
Copy link
Contributor

disberd commented Nov 15, 2021

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)

@fonsp fonsp added the macro Julia macros: @oops label Nov 15, 2021
@fonsp
Copy link
Owner

fonsp commented Nov 15, 2021

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 )

@dralletje
Copy link
Collaborator

dralletje commented Nov 15, 2021

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

@fonsp fonsp added the other packages Integration with other Julia packages label Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macro Julia macros: @oops other packages Integration with other Julia packages
Projects
None yet
Development

No branches or pull requests

3 participants