-
-
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
document how to pretty-print objects #18634
Conversation
These should be doctests |
|
||
More fine-grained control over display of ``Polar`` objects is possible. | ||
In particular, sometimes one wants both a verbose multi-line printing | ||
format, used for displaying an single object in the REPL and other interactive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a single object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
I think PR's that aren't absolutely trivial or urgent should remain open at least long enough for contributors in all time zones to get a chance to review them before they get merged. |
|
||
Base.show{T}(io::IO, ::MIME"text/html", z::Polar{T}) = | ||
println(io, "<code>Polar{$T}<code> complex number: ", | ||
z.r, " <i>e</i><sup>", z.Θ, " <i>i</i></sup>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to use inline HTML in Markdown to show how this looks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I can add it to #18649 via the .. raw:: html
technique.
* add pretty-printing doctests (for #18634) * in the HTML manual, render the HTML pretty-printing example
* add pretty-printing doctests (for #18634) * in the HTML manual, render the HTML pretty-printing example
Thanks for adding this, but I think I'm even more confused than before. Indeed the manual now says we should use the two-argument So how are these two mechanisms related? Should they be used for different things? |
The tl;dr difference should be:
|
Thanks. So the manual should stop recommending the two-argument form of |
It seems like "unformatted" may be a better term, since describing it as "compact" is ambiguous with the |
Despite being semi-convinced when Jameson, Jeff and I hashed this out in person after JuliaCon, I think this current design is too complicated and hard to explain. The multiline option was easier to explain than this. We should probably come up with something clearer for the next release. |
The
|
There's also the issue with |
This fixes #9458.
This has come up a zillion times on julia-users (here, here, here, here, here, here, here, ....). I can't believe we've gone this long without a manual section on it.