# Concise way to apply one docstring to multiple items

**URL:** <https://discourse.julialang.org/t/concise-way-to-apply-one-docstring-to-multiple-items/123637>\
**Category:** General Usage\
**Tags:** documentation\
**Created:** [December 9, 2024, 11:03pm UTC](https://discourse.julialang.org/t/concise-way-to-apply-one-docstring-to-multiple-items/123637 "2024-12-09T23:03:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tetrakai](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Post date:** [December 9, 2024, 11:03pm UTC](https://discourse.julialang.org/t/concise-way-to-apply-one-docstring-to-multiple-items/123637/1 "2024-12-09T23:03:06Z")

</div>

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

```julia
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:

```julia
"""`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?

---

<div class="post-metadata">

**Author:** ![matthias314](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Post date:** [December 9, 2024, 11:05pm UTC](https://discourse.julialang.org/t/concise-way-to-apply-one-docstring-to-multiple-items/123637/2 "2024-12-09T23:05:09Z")

</div>

You can say something like

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

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

```

Does this address your question?

---

<div class="post-metadata">

**Author:** ![Tetrakai](https://avatars.discourse-cdn.com/v4/letter/t/4da419/32.png) [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Post date:** [December 9, 2024, 11:13pm UTC](https://discourse.julialang.org/t/concise-way-to-apply-one-docstring-to-multiple-items/123637/3 "2024-12-09T23:13:33Z")

</div>

> [@matthias314](#):
>
> ```julia
> """
> docstring for `f`, `g`, `h`
> """
> f, g, h
> 
> f(x) = x
> g(x, y) = x+y
> h() = 1
> 
> ```

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?
