# Display docstring for extension method in documentation

**URL:** <https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720>\
**Category:** General Usage\
**Tags:** documentation, documenter, package-extensions\
**Created:** [June 1, 2023, 11:14am UTC](https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720 "2023-06-01T11:14:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [June 1, 2023, 11:14am UTC](https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720/1 "2023-06-01T11:14:02Z")

</div>

What should I do I want to document a method defined in an extension? Of course I wrote a docstring but said docstring isn’t displayed in the Documenter.jl build, even when I load the conditional dependencies before loading my package in `docs/make.jl`. Has anyone faced that issue?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 1, 2023, 12:15pm UTC](https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720/2 "2023-06-01T12:15:13Z")

</div>

Does [Issues with package extensions · Issue #2124 · JuliaDocs/Documenter.jl · GitHub](https://github.com/JuliaDocs/Documenter.jl/issues/2124) help?

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [June 1, 2023, 12:44pm UTC](https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720/3 "2023-06-01T12:44:25Z")

</div>

Yes indeed, it’s a bit ugly but it works 🙂

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 20, 2025, 11:57am UTC](https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720/4 "2025-02-20T11:57:15Z")

</div>

Sorry to revive this, but the solution in the issue does not seem to be helping here.

My situation is the following: I have a custom type in my package, `ContactMap`, and in `ext/Plotting.jl` I define a method to produce a heatmap for that type:

```julia
import Plots: heatmap
"""
    heatmap(::ContactMap)

# etc

"""
function heatmap(::ContactMap) end

```

I’m trying to include this docstring in the manual, with:

````julia
```@docs
heatmap(::ContactMap) 
```#

````

but that’s not working:

````julia
  No Changes to `~/.julia/dev/PDBTools/docs/Manifest.toml`
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
┌ Error: no docs found for '!!! warning "Missing docstring."
│ 
│ Missing docstring for `heatmap(::ContactMap)`. Check Documenter's build log for details.' in `@docs` block in src/contacts.md:6-11
│ ```@docs
│ ContactMap
│ contact_map
│ heatmap(::ContactMap)
│ residue_residue_distance
│ 

````

Should that work, according to the issue mentioned above? Or is it a different situation?

I’m loading both `Plots` and my package in `docs/make.jl`.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [February 20, 2025, 1:53pm UTC](https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720/5 "2025-02-20T13:53:08Z")

</div>

> [@lmiq](#):
>
> I’m loading both `Plots` and my package in `docs/make.jl`.

Do you load the extension too? Among the `modules` argument to `makedocs`

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 20, 2025, 2:26pm UTC](https://discourse.julialang.org/t/display-docstring-for-extension-method-in-documentation/99720/6 "2025-02-20T14:26:49Z")

</div>

How does one do that? Or, more generally, how can I load the extension without loading `Plots` altogether?

ok, this is what that means in this context:

```julia
    modules = [
        MyPackage, 
        isdefined(Base, :get_extension) ? Base.get_extension(MyPackage, :Plotting) : PDBTools.Plotting
    ],

```
