Correct. This still needs a doc update (I added #16763 to the v0.5.x 
milestone). The two-argument form `show(io, x)` should produce a concise, 
single line description that formats reasonably into any unknown context.

The three-argument mime-format aware version `show(io, mime, x)` can be 
additionally overloaded to produce a complete, reactive, expanded 
representation.


On Saturday, July 2, 2016 at 8:38:51 AM UTC-4, Fengyang Wang wrote:
>
> It is no longer true that
>
> show(io, x)
>
> should be overriden for MIME text/plain. Instead, the MIME version is for 
> multiline display, and the two-argument form for single-line display. See 
> https://github.com/JuliaLang/julia/pull/17113.
>
>
> On Saturday, July 2, 2016 at 8:06:28 AM UTC-4, Steven G. Johnson wrote:
>>
>> On Saturday, July 2, 2016 at 5:11:16 AM UTC-4, Sheehan Olver wrote:
>>>
>>> What has replaced writemime?  I'm trying to fix the 0.5 deprecation 
>>> warnings.
>>>
>>
>> writemime(io, mime, x) has been renamed to show(io, mime, x), and show is 
>> now the correct method to override to change how an object is displayed 
>> with various mime types.  If mime == text/plain, you can just do show(io, 
>> x) , and you should override the 2-argument show to change an object's text 
>> output.
>>
>> For 0.4 compatibility, you can use Compat and o
>>
>> @compat Base.show(io::IO, mime::MIME"....", x::MyType) = ....
>>
>> and it will rewrite to a writemime definition on older versions.
>>
>

Reply via email to