JuliaDocs / JuliaDocs/DocStringExtensions.jl
Default argument value in function documentation
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 126
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
Consider the following documentation for a function f1 in a module CGP
"""
$(TYPEDSIGNATURES)
"""
function f1(a::Int, b::Int=0)
return a + b
end
The generated documentation is

Two signatures are produced, but information of the default value is lost. I have to document the default value of b manually.
Is it possible to produce a single signature that contains the default value? Something like follows
f1(a::Int64, b::Int64=0) -> Int64
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the documented f1(a::Int, b::Int=0) example in module CGP and inspect how TYPEDSIGNATURES generates its two signatures. Compare the generated output with the requested single signature containing b=0; done means default values are preserved without manual documentation, with existing documentation behavior still working.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100