Skip to content

Format docstrings #120

@stelmo

Description

@stelmo

Is there a way to generate formatted docstrings using DocStringExtensions.jl? For example, in a package we are currently developing our docstrings are defined like this:

"""
    add_reactions(
        m::CoreModel,
        s::V1,
        b::V2,
        c::AbstractFloat,
        xl::AbstractFloat,
        xu::AbstractFloat;
        check_consistency = false,
    ) where {V1<:VecType,V2<:VecType}

Add reaction(s) to a `CoreModel` model `m`.
"""

but we would like to make use of DocStringExtentions.jl like this:

"""
    $(TYPEDSIGNATURES)

Add reaction(s) to a `CoreModel` model `m`.
"""

However, the generated docstrings look like this:

help?> add_reactions
search: add_reactions add_reactions! @add_reactions! with_added_reactions add_reaction!

  add_reactions(m::CoreModel, s::V1<:AbstractVector{Float64}, b::V2<:AbstractVector{Float64}, c::AbstractFloat, xl::AbstractFloat, xu::AbstractFloat; check_consistency) -> Union{CoreModel, Tuple{CoreModel, Vector{Int64}, Vector{Int64}}}
  
  Add reaction(s) to a CoreModel model m.

which makes it difficult to read. It would be great if we could format them somehow. Is there functionality for this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions