Skip to content
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

Print the type's help for undocumented bindings #13002

Closed
mbauman opened this issue Sep 7, 2015 · 1 comment · Fixed by #13013
Closed

Print the type's help for undocumented bindings #13002

mbauman opened this issue Sep 7, 2015 · 1 comment · Fixed by #13013
Labels
docsystem The documentation building system good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@mbauman
Copy link
Member

mbauman commented Sep 7, 2015

In 0.3:

julia> sparse([1,2,3]);

help?> ans

    [1, 1]  =  1
    [2, 1]  =  2
    [3, 1]  =  3 is of type
DataType   : SparseMatrixCSC{Int64,Int64} (constructor with 1 method)
  supertype: AbstractSparseArray{Int64,Int64,2}
  fields   : (:m,:n,:colptr,:rowval,:nzval)

Currently:

help?> ans
search: ans transpose transpose! ctranspose ctranspose! randsubseq randstring

This was a nice way to explore an API. It'd be nice for an undocumented binding/object to print out its type and the type's help (which is much nicer now with #12996).

@mbauman mbauman added help wanted Indicates that a maintainer wants help on an issue or pull request good first issue Indicates a good issue for first-time contributors to Julia docsystem The documentation building system labels Sep 7, 2015
@MichaelHatherly
Copy link
Member

Yeah, would be good to have. I didn't really like the way it echoed the object itself since sometimes that would be distracting if it's a large object.

This would probably just need some minor changes to

julia/base/docs/Docs.jl

Lines 98 to 101 in 5edd47c

function doc(b::Binding)
d = invoke(doc, Tuple{Any}, b)
d == nothing ? doc(getfield(b.mod, b.var)) : d
end
I think.

@jakebolewski jakebolewski reopened this Sep 8, 2015
jakebolewski added a commit that referenced this issue Sep 8, 2015
exclude macros as this is just exposing their internals

closes #13002
jakebolewski added a commit that referenced this issue Sep 8, 2015
exclude macros as this is just exposing their internals

closes #13002
jakebolewski added a commit that referenced this issue Sep 9, 2015
add fallback output for macros and update tests

closes #13002
jakebolewski added a commit that referenced this issue Sep 10, 2015
add fallback output for macros and update tests

closes #13002
jakebolewski added a commit that referenced this issue Sep 11, 2015
add fallback output for macros and update tests

closes #13002

(cherry picked from commit b6cc2ed)
ref #13013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system good first issue Indicates a good issue for first-time contributors to Julia help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants