# Documenter: callable objects

**URL:** <https://discourse.julialang.org/t/documenter-callable-objects/36239>\
**Category:** General Usage\
**Created:** [March 20, 2020, 1:00am UTC](https://discourse.julialang.org/t/documenter-callable-objects/36239 "2020-03-20T01:00:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 20, 2020, 1:00am UTC](https://discourse.julialang.org/t/documenter-callable-objects/36239/1 "2020-03-20T01:00:32Z")

</div>

Is it possible to document a callable object “call” definition?  
Documenter complains about documentation not found. This is the code location: ([MeshCore.jl/increl.jl at 80229d26e7a7e4a821b04df2815604101e595375 · PetrKryslUCSD/MeshCore.jl · GitHub](https://github.com/PetrKryslUCSD/MeshCore.jl/blob/80229d26e7a7e4a821b04df2815604101e595375/src/increl.jl#L42)).

---

<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:** [May 28, 2026, 5:08pm UTC](https://discourse.julialang.org/t/documenter-callable-objects/36239/2 "2026-05-28T17:08:25Z")

</div>

I’m wondering about this, too. Maybe the easiest example is the following:

```julia-auto
"B doc"
struct B end

"B callable doc"
(::B)(x) = 1

```

With docs/src/index.md of the form

````julia-auto
```@docs
B
(::B)(::Any)
```

````

the first docstring works, but Documenter.jl complains about the second:

```julia-auto
Error: unable to get the binding for '(::B)(::Any)' in `@docs` block in src/index.md:1-4 from expression ':((::B)(::Any))' in module Main

```

How does one do this correctly?

BTW, if one only says

````julia-auto
```@docs
B
```

````

then Documenter.jl does _not_ complain that the second docstring is not included in the documentation.

(I’m using Documenter.jl v1.17.)

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [May 30, 2026, 3:48pm UTC](https://discourse.julialang.org/t/documenter-callable-objects/36239/3 "2026-05-30T15:48:02Z")

</div>

The callable should be documented as part of the `struct` docstring. I would generally advise against splitting up docstrings too much: document functions (or structs), not methods.

---

<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:** [May 30, 2026, 4:19pm UTC](https://discourse.julialang.org/t/documenter-callable-objects/36239/4 "2026-05-30T16:19:46Z")

</div>

Julia allows to attach docstrings to callable methods like `(::B)(x)` above. Moreover,

```julia-auto
help> B()(1)

```

only returns the docstring for the callable method, not for `B` itself. It’s of course debatable whether attaching a docstring to a callable method is a good idea. However, given that this feature exists in Julia, I think it would make sense for Documenter.jl to support it and leave the decision to the user.
