Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Display at REPL #11

Closed
timholy opened this issue Sep 23, 2014 · 4 comments
Closed

Display at REPL #11

timholy opened this issue Sep 23, 2014 · 4 comments

Comments

@timholy
Copy link

timholy commented Sep 23, 2014

In IJulia, Lexicon gives nice display. But from the "naked" REPL, I get this:

julia> query(query)
>>>

 [function] Lexicon.query

Entry{:function}(MarkdownDocstring("Search packages for *Docile.jl* generated documentation."),[:source=>(77,"/home/tim/.julia/v0.3/Lexicon/src/query.jl")])>>>

 [method] Lexicon.query(q)

Entry{:method}(MarkdownDocstring("\nSearch through loaded documentation for the query term `q`. `q` can be a\n`String`, for full text searches, or an object such as a function or\ntype. When searching for macros, methods, or globals use the provided\n`@query` macro instead.\n\nThe search can be restricted to particular modules by listing them\nafter the search term `q`.\n\n**Examples:**\n\nDisplay documentation for the `Lexicon.Summary`:\n\n```julia\nquery(Lexicon.Summary)\n```\n\nTo display the documentation for a function, but not the associated\nmethods use `all = false` as a keyword to `query`.\n\n```julia\nquery(query; all = false)\n```\n\nQuerying can be narrowed down by providing a module or modules to\nsearch through (defaults to searching `Main`).\n\n`categories` further narrows down the types of results returned. Choices\nfor this are `:method`, `:global`, `:function`, `:macro`, `:module`, and\n`:type`. These options are more useful when doing a text search rather\nthan an object search.\n\n```julia\nquery(\"Examples\", Lexicon; categories = [:method, :macro])\n```\n\n"),[:source=>(55,"/home/tim/.julia/v0.3/Lexicon/src/query.jl"),:returns=>(Entries,)])>>>

 [method] Lexicon.query(q,modules...)

Entry{:method}(MarkdownDocstring("\nSearch through loaded documentation for the query term `q`. `q` can be a\n`String`, for full text searches, or an object such as a function or\ntype. When searching for macros, methods, or globals use the provided\n`@query` macro instead.\n\nThe search can be restricted to particular modules by listing them\nafter the search term `q`.\n\n**Examples:**\n\nDisplay documentation for the `Lexicon.Summary`:\n\n```julia\nquery(Lexicon.Summary)\n```\n\nTo display the documentation for a function, but not the associated\nmethods use `all = false` as a keyword to `query`.\n\n```julia\nquery(query; all = false)\n```\n\nQuerying can be narrowed down by providing a module or modules to\nsearch through (defaults to searching `Main`).\n\n`categories` further narrows down the types of results returned. Choices\nfor this are `:method`, `:global`, `:function`, `:macro`, `:module`, and\n`:type`. These options are more useful when doing a text search rather\nthan an object search.\n\n```julia\nquery(\"Examples\", Lexicon; categories = [:method, :macro])\n```\n\n"),[:source=>(55,"/home/tim/.julia/v0.3/Lexicon/src/query.jl"),:returns=>(Entries,)])

This is on Kubuntu 14.04.

@timholy
Copy link
Author

timholy commented Sep 23, 2014

I should add that

using Markdown
readme("Markdown")

produces nice formatted output at the REPL.

@MichaelHatherly
Copy link
Owner

I think that's probably from the method warnings at load-time:

Warning: New definition 
    writemime(Any,MIME{symbol("text/plain")},Entry{category}) at /home/mike/.julia/v0.4/Lexicon/src/render.jl:79
is ambiguous with: 
    writemime(IO,MIME{symbol("text/plain")},Any) at replutil.jl:2.
To fix, define 
    writemime(IO,MIME{symbol("text/plain")},Entry{category})
before the new definition.

If you do a Pkg.checkout("Lexicon") does it then display properly at the REPL?

@timholy
Copy link
Author

timholy commented Sep 23, 2014

Yes, master does not show any method ambiguities, and likewise displays nicely in the REPL.

@MichaelHatherly
Copy link
Owner

Closed by 01fb989

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants