Skip to content

how to make signaures -> result docstrings #206

Description

@tpapp

I would like to have document returned values of functions in some cases, without repeating the signature, and I am not quite sure how to do that with DocStringExtensions.

"""
$(SIGNATURES) → success::Bool
"""
my_operation(args) = all(isfinite, args)

puts → success::Bool outside the block.

Activity

  1. MichaelHatherly commented on Oct 10, 2026

    @MichaelHatherly
    Member

    By the way that the interpolation works it just can't behave like you're wanting it to with the return written on the outside. It would need to be some kind of arg to the abbreviation itself to end up in the code block that is generated. It's a feature worth adding probably, not sure exactly what it'll look like though.

  2. tpapp commented on Oct 12, 2026

    @tpapp
    ContributorAuthor

    Just brainstorming: MethodSignature could take an argument that inserts markdown after the signature.

    But having multiple lines would be cumbersome.

    I have to admit that I still don't understand why there can be multiple lines for "$SIGNATURES", ie why it invokes methodgroups.

  3. MichaelHatherly commented on Oct 13, 2026

    @MichaelHatherly
    Member

    I have to admit that I still don't understand why there can be multiple lines for "$SIGNATURES", ie why it invokes methodgroups.

    It did it since it might be applied to a method with optional args, which would give two or more method objects in the list. An additional feature of signatures abbrv might be to condense the signatures into a single one that uses the common [, optional_arg] syntax that people use.

  4. added a commit that references this issue on Oct 17, 2026
    653999a
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions