JuliaLang/julia

Improve apropos display

Open

#12,989 opened on Sep 6, 2015

View on GitHub
 (5 comments) (1 reaction) (0 assignees)Julia (48,709 stars) (5,773 forks)batch import
Hacktoberfestdocsystemgood first issuehelp wanted

Description

Currently, apropos' output is quite simple — it's just the objects whose docstrings match the search text:

julia> apropos("pearson")
cov
cor

It might be nice to make this display a bit richer. We could additionally print out the first non-code documentation line to the edge of the screen, e.g.,

julia> apropos("pearson")
cov      - Compute the Pearson covariance between the vector(s) in…
cor      - Compute the Pearson correlation between the vector(s) i…

It also might be nice to make it return a Julia type that simply contains an array of objects and their documentation, so IJulia and other non-REPL programs can format it a little nicer or linkify the text for full documentation. This does have the downside of making the display non-incremental, making it feel a little slower, but it may be worth it.

The implementation is also quite simple and should be fairly simple to extend.

Contributor guide