Skip to content

Format for all docstrings for a particular function #160

Closed as not planned
Closed as not planned

Description

@tomerarnon

I would like a docstring for my many-method functions to look like:

    f(x::Int, y::Float)
Does something with `x` and `y`. 
defined at [blah.jl:100](link)
- - - 
    f(x::String)
Does something with a string.
defined at [blah.jl:120](link)
- - -
    f(x::Int, y::Int, z::Int)
Does a completely different thing
defined at [elsewhere.jl:5](link)
- - -
    f(b::Blah)                             # note: these last two don't have docstrings, but I still want them listed here.
defined at [elsewhere.jl:15](link)
- - -
    f(a, b)
defined at [elsewhere.jl:30](link)

It's some combination of typedsignatures + methodlist, but not quite either of them.... Is this achievable with any of the abbreviations/combinations in DocStringExtensions?

Activity

  1. MichaelHatherly commented on Oct 14, 2026

    @MichaelHatherly
    Member

    Sorry for the long wait. It could possibly be done with an option to METHODLIST that pulled in the docstring content from each method listed, but I don't believe that this is a good idea. Doing that ends up showing duplicated docs content when you do ?f then since the REPL's behaviour is to concat all the docstrings already. In Documenter it would warn/error if you don't include all the documented objects, so you'd end up having to have them all listed twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions