-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documenting methods for the same function in different modules #13068
Labels
docsystem
The documentation building system
Comments
All the docs are still being captured. The problem is here where only the first module that has docs is returned. Something like the following would fix it: diff --git a/base/docs/Docs.jl b/base/docs/Docs.jl
index f248ace..970915e 100644
--- a/base/docs/Docs.jl
+++ b/base/docs/Docs.jl
@@ -238,6 +238,7 @@ doc(f::Function) = doc(f, Tuple)
function doc(f::Function, sig::Type)
isgeneric(f) && isempty(methods(f,sig)) && return nothing
+ docs = []
for mod in modules
if (haskey(meta(mod),f) && isa(meta(mod)[f],FuncDoc))
fd = meta(mod)[f]
@@ -250,14 +251,14 @@ function doc(f::Function, sig::Type)
end
# if all method signatures are Union{} ( ⊥ ), concat all docstrings
if isempty(results)
- return catdoc([fd.meta[msig] for msig in reverse(fd.order)]...)
+ push!(docs, catdoc([fd.meta[msig] for msig in reverse(fd.order)]...))
else
sort!(results, lt=(a,b)->type_morespecific(first(a),first(b)))
- return catdoc([last(r) for r in results]...)
+ push!(docs, catdoc([last(r) for r in results]...))
end
end
end
- return nothing
+ isempty(docs) ? nothing : catdoc(docs...)
end
doc(f::Function,args::Any...) = doc(f, Tuple{args...}) |
Merged
MichaelHatherly
added a commit
to MichaelHatherly/julia
that referenced
this issue
Sep 11, 2015
Searching for function documentation only checked the first module that had any documentation for the `Function`, other candidate modules were ignored. Fixes JuliaLang#13068.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There seems to be a problem with documenting the same function in different module. I think this should work in general and is important for linear algebra documentation strings where methods for the function are often defined in
LinAlg
andSparseMatrix
. An example of the problem isThe text was updated successfully, but these errors were encountered: