Conversation
| eval(Multimedia, quote | ||
| export @MIME | ||
| macro MIME(s) | ||
| Base.warn_once("@MIME(\"\") is deprecated, use MIME\"\" instead.") |
There was a problem hiding this comment.
apparently this has been deprecated for almost 3 years, just was never in this file - I think it would be safe to just delete it? af8c18c
262230d to
32003dd
Compare
| end | ||
| end | ||
| end | ||
| show(io::IO, iter::Union{KeyIterator,ValueIterator}) = show(io, collect(iter)) |
There was a problem hiding this comment.
this will be showing them as if they're a different type than they actually are? should at least have a header?
edit: or what determines when this gets called vs the mime version in replutil?
There was a problem hiding this comment.
it'll show them in compact form without a header (ie. when you call show directly, instead of displaying a mimetype)
|
This seems to make it impossible to implement single and multiline output for different mime types. |
|
Can you give an example? This doesn't prevent you from making writers for other mimetypes. |
|
IIUC, this puts multiline output in methods with mimetypes, and single line output in methods with 2 arguments. So how do you define both single and multiline output for html? |
By using the (not yet provided by a package) Builder-type objects. This change defines the mime-type methods as outputting documents, and the show methods as outputting strings. The overlap between the two would be handled by the IO object, when outputting a mime-aware value into a document-aware context. |
|
OK, I think where we ended up on this is to do this change for now, and if we need to implement single-line outputs for, say, HTML, that can be expressed by passing a display height of 1 in the IOContext. |
|
I've restarted the AV build. @vtjnash if it passes, do you want to rebase and see if that passes CI, and then merge? |
32003dd to
f9fe68b
Compare
|
Rebased. |
f9fe68b to
256a296
Compare
| end | ||
| end | ||
|
|
||
| show(io::IO, ::MIME"text/plain", X::AbstractArray) = showarray(io, X, false) |
There was a problem hiding this comment.
@vtjnash Following up on my other comment. Why did you define these methods for MIME"text/plain" instead of two-argument show as #16563 prescribes?
this attribute doesn't nest properly,
and functions just end up branching almost the entire code based
on this parameter, so it's cleaner as a separate method
fix #17087
fix #16910
fix #17090