Concise way to apply one docstring to multiple items

Eg, I would like to put all of these in the same docstring:

padintm5  = generate_formatter( "%-5i")
padstrm21 = generate_formatter( "%-21s")
padstr4   = generate_formatter( "%4s")
padint3   = generate_formatter( "%3i")
padint4   = generate_formatter( "%4i")
padint5   = generate_formatter( "%5i")
padint6   = generate_formatter( "%6i")

Same here:

"""`MAXPLAYERS :: Int` - Maximum number of players per team. The roster must contain *exactly* this many entries. 
Teams with fewer players are padded with a placeholder. See also: [`RosterInfo`](@ref)."""
const MAXPLAYERS = 30
"""`NSUBS :: Int` - Number of subs *included in the teamsheet*. See also: [`UpdateConfig`](@ref)."""
const NSUBS = 5
"""`NLINEUP :: Int` - Number of players in the teamsheet. Eleven starters plus NSUBS."""
const NLINEUP = 11 + NSUBS

Is there a way without cluttering the code with a line before each related entry?

You can say something like

"""
    docstring for `f`, `g`, `h`
"""
f, g, h

f(x) = x
g(x, y) = x+y
h() = 1

Does this address your question?

2 Likes

Thanks, that looks perfect.

It works for the help in the REPL but not the LSP-julia plugin (Sublime Text) though. Is that only a issue with Sublime or does it work with VScode?