Is it possible for Documenter.jl to auto-generate type signatures? So that having a docstring like:
"""
This does foo.
"""
foo(bar, baz; quux=10) = 42
Would create documentation like:
foo(bar, baz; quux=10)
This does foo.
I've googled a bit but couldn't find anything.
I think JuliaFormatter.jl can be told to do that IIRC
Ah hah, thanks.
I haven't actually tried it to see what it looks like, but there's one option that looks like it might do what you want?
Yeah I see there's format_docstrings
.
You can checkout https://github.com/JuliaDocs/DocStringExtensions.jl
@James Wrigley From the manual:
Since the function name is given by the signature, there is no need to start the documentation with "The function bar...": go straight to the point. Similarly, if the signature specifies the types of the arguments, mentioning them in the description is redundant.
So hopefully it doesn't do that
Also:
Only provide an argument list when really necessary.
For simple functions, it is often clearer to mention the role of the arguments directly in the description of the function's purpose.
Fredrik Ekre said:
You can checkout https://github.com/JuliaDocs/DocStringExtensions.jl
Oooo yes that does look like what I want :eyes:
Michael Fiano said:
Also:
Only provide an argument list when really necessary.
For simple functions, it is often clearer to mention the role of the arguments directly in the description of the function's purpose.
I think this is referring to an explicit list of arguments in the docstring, not their presence in the type signature?
Last updated: Nov 22 2024 at 04:41 UTC