# Calling @docs twice for the same function in Documenter.jl

**URL:** <https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [April 17, 2020, 10:41pm UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791 "2020-04-17T22:41:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [April 17, 2020, 10:41pm UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791/1 "2020-04-17T22:41:49Z")

</div>

When using Documenter.jl say I have the following two markdown files,

Page1.md

```julia
some text 1
``@docs
foo
``

```

Page2.md

```julia
some text 2
``@docs
foo
``

```

I observe that this results in a warning of the form, `Warning: duplicate docs found for 'foo' in `@docs` block in src/Page2.md` and then when Page2.md is rendered it will say `Missing docstring for foo. Check Documenter's build log for details.`

Is this as designed or a known bug? Do anyone know a work around?

One live example,

The docs for `run_opf_ptdf_flow_cuts` appear here,  
[https://lanl-ansi.github.io/PowerModels.jl/stable/power-flow/#PowerModels.run\_opf\_ptdf\_flow\_cuts](https://lanl-ansi.github.io/PowerModels.jl/stable/power-flow/#PowerModels.run_opf_ptdf_flow_cuts)

but not at the bottom of this page,  
[https://lanl-ansi.github.io/PowerModels.jl/stable/utilities/](https://lanl-ansi.github.io/PowerModels.jl/stable/utilities/)

---

<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:** [April 17, 2020, 11:35pm UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791/2 "2020-04-17T23:35:05Z")

</div>

[https://github.com/JuliaDocs/Documenter.jl/issues/1079](https://github.com/JuliaDocs/Documenter.jl/issues/1079)

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [April 17, 2020, 11:47pm UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791/3 "2020-04-17T23:47:41Z")

</div>

Thanks!

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [April 19, 2020, 7:32pm UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791/4 "2020-04-19T19:32:50Z")

</div>

@fredrikekre, as a work around for this, is there a way to refrence a function name in the docs that links to the location where it docs are defined?

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [April 19, 2020, 8:16pm UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791/5 "2020-04-19T20:16:01Z")

</div>

[https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#@ref-link-1](https://juliadocs.github.io/Documenter.jl/stable/man/syntax/#@ref-link-1)

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [April 19, 2020, 9:20pm UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791/6 "2020-04-19T21:20:24Z")

</div>

`@ref` works great. Thanks @heliosdrm!

---

<div class="post-metadata">

**Author:** ![PharmCat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pharmcat/32/6953_2.png) [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Post date:** [February 10, 2021, 11:43am UTC](https://discourse.julialang.org/t/calling-docs-twice-for-the-same-function-in-documenter-jl/37791/7 "2021-02-10T11:43:40Z")

</div>

`[foo](@ref)` make reference to foo, not duplicate…

is a way to do duplicate?
