I would like to add the documentation of a function to the official documentation page. It should have been a one liner to do this, but now I am somehow stuck…
There is already a docstring available. However, I need to add the function declaration to the docs/src/index.md
file.
The function looks like this:
(I::UniformScaling)(n::Integer) = Diagonal(fill(I.λ, n))
And this is how I tried to add this to the index.md file:
(::LinearAlgebra.UniformScaling)(::Integer)
The doctests return the following error:
��� exception = `binding` cannot understand expression `::LinearAlgebra.UniformScaling`.
��� @ Documenter.Expanders /buildworker/worker/doctest_linux64/build/doc/deps/packages/Documenter/QQWIJ/src/Expanders.jl:285
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
ERROR: LoadError: `makedocs` encountered an error. Terminating build
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] runner(::Type{Documenter.Builder.RenderDocument}, ::Documenter.Documents.Document) at /buildworker/worker/doctest_linux64/build/doc/deps/packages/Documenter/QQWIJ/src/Builder.jl:242
[3] dispatch(::Type{Documenter.Builder.DocumentPipeline}, ::Documenter.Documents.Document) at /buildworker/worker/doctest_linux64/build/doc/deps/packages/Documenter/QQWIJ/src/Utilities/Selectors.jl:167
[4] #2 at /buildworker/worker/doctest_linux64/build/doc/deps/packages/Documenter/QQWIJ/src/Documenter.jl:237 [inlined]
[5] cd(::Documenter.var"#2#3"{Documenter.Documents.Document}, ::String) at ./file.jl:104
[6] #makedocs#1 at /buildworker/worker/doctest_linux64/build/doc/deps/packages/Documenter/QQWIJ/src/Documenter.jl:236 [inlined]
[7] top-level scope at /buildworker/worker/doctest_linux64/build/doc/make.jl:183
[8] include(::Function, ::Module, ::String) at ./Base.jl:382
[9] include(::Module, ::String) at ./Base.jl:370
[10] exec_options(::Base.JLOptions) at ./client.jl:296
[11] _start() at ./client.jl:506
in expression starting at /buildworker/worker/doctest_linux64/build/doc/make.jl:183
make: *** [html] Error 1
make: Leaving directory `/buildworker/worker/doctest_linux64/build/doc'
program finished with exit code 2
elapsedTime=308.675113
I already tried to replicate this error in REPL but it should have worked:
using LinearAlgebra, Documenter
@doc (::UniformScaling)(::Integer) #returns the correct documentation
using Documenter
import LinearAlgebra
@doc (::LinearAlgebra.UniformScaling)(::Integer) #returns the correct documentation
I believe the issue is because Documenter misunderstands function like objects.
Does anyone know how to add these to the documentation page?
(Edit: ) This is linked to this pull request.