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

Not able to document `@resumable` functions

Open siddharthlal25 opened this issue 5 years ago • 4 comments

Doing this:

"""
    filenames(...)

docstring
"""
@resumable function filenames(...)
...
end

throws an error, error being:

cannot document the following expression:

#= /home/siddharth/.julia/dev/CCDReduction.jl/src/collection.jl:105 =# @resumable function filenames(df::DataFrame)

siddharthlal25 avatar Jun 29 '20 22:06 siddharthlal25

The workaround was:

"""
    filenames(...)

docstring
"""
function filenames end

@resumable function filenames(...)
...
end

It would be nice to add a functionality that allows users to document directly above @resumable function.

siddharthlal25 avatar Jun 29 '20 22:06 siddharthlal25

Yes, this would be nice

hdavid16 avatar Jul 08 '20 16:07 hdavid16

I will look at this issue but I think the workaround is the easiest way to document resumable functions

BenLauwens avatar Jan 05 '21 15:01 BenLauwens

I am using Documenter.jl and I have similar issue. The workaround is in my opinion only temporal solution. I suggest adding encapsulation of the function as follows

@resumable begin
"""
    filenames(...)

docstring
"""
function filenames(...)
...
end
end

detrin avatar May 19 '21 09:05 detrin

To be fixed in #71 - for future reference, one simply needs to use Base.@__doc__ for situations like this.

Krastanov avatar Aug 08 '23 02:08 Krastanov