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

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

Page1.md

some text 1
``@docs
foo
``

Page2.md

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

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

1 Like

https://github.com/JuliaDocs/Documenter.jl/issues/1079

3 Likes

Thanks!

@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?

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

1 Like

@ref works great. Thanks @heliosdrm!

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

is a way to do duplicate?

3 Likes