-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Have a way to use Pluto default show
for types which define a custom show
method
#2997
Comments
show
for custom types which define a custom show
methodshow
for types which define a custom show
method
Having a way to "display this object as a Pluto object tree of ..." would also be very nice! |
Here's the Zulip thread with the request: https://julialang.zulipchat.com/#narrow/channel/243342-pluto.2Ejl/topic/show.20method |
Here's two potential ways to handle this:
Base.show(io::IO, ::MIME"text/html", x::MyType) = PlutoRunner.pluto_show(io, x)
PlutoRunner.use_treeview(::MyType) = true |
Wouldn't it make sense to have a Base.show(io::IO, mime::MIME"text/pluto", x::MyType) = @invoke show(io, mime, x::Any) to get the default Furthermore,
|
We can add this the |
Currently, if I create a type
MyType
and define a overrideBase.show(io::IO, x::MyType)
orBase.show(io::IO, ::MIME"text/plain", x::MyType)
, then I lose the defaultshow
method in Pluto, and there is not method to get it back.It would be good to be able to decide I want my type to have a custom
show
in the REPL but do not impact the Pluto default show method.I remember somebody raised this issue question before in either zulip/discourse but can't find it anymore.
Discussed this today at the dev call and @fonsp also agrees that we should have this capability
The text was updated successfully, but these errors were encountered: