rmfritz
November 26, 2023, 10:51pm
1
I was surprised to find that the Julia documentation style guide says nothing about documenting structs. Is this something just not done? If it is done, does anyone have advice about best practices?
mkitti
November 26, 2023, 11:14pm
2
Well there is a small section.
https://docs.julialang.org/en/v1/manual/documentation/#Types
You may be interested in the package DocStringExtensions.jl, which is perhaps best explained by example:
$(TYPEDSIGNATURES)
For comparison, [`SIGNATURES`](@ref) abbreviation:
$(SIGNATURES)
"""
bar(x::AbstractArray{T}, y::U) where {T <: Integer, U <: AbstractString} = 0
"""
The [`TYPEDEF`](@ref) abbreviation includes the type signature:
$(TYPEDEF)
---
The [`FIELDS`](@ref) abbreviation creates a list of all the fields of the type.
If the fields has a docstring attached, that will also get included.
$(FIELDS)
rmfritz
November 26, 2023, 11:28pm
3
Ah. Under “Types.” I missed that. Thank you.