JuliaDocs / JuliaDocs/DocStringExtensions.jl
include defaults for Base.@kwdef structs in FIELDS (or something else)
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 126
- Forks
- 35
- PR merge metrics
- No merged PRs in 30d
Description
In a struct that was defined with Base.@kwdef, is it possible to generate a docstring similar to what FIELDS currently does, but with defaults? MWE:
using DocStringExtensions
"""
$(FIELDS)
"""
Base.@kwdef struct Foo
a::Int = 1
end
should show something like
- a = 1
I am not even sure if this is conceptually possible though, or if there is a reasonable workaround. Related: #19.
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
Start by reading the existing FIELDS implementation and investigating how Base.@kwdef represents field defaults during docstring generation. Determine whether those defaults are accessible, then verify the MWE can produce a field entry such as - a = 1, or document a reasonable workaround if it cannot.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100