Skip to content
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

Generalized falling back show + mimetype #289

Open
oxinabox opened this issue Feb 20, 2021 · 0 comments
Open

Generalized falling back show + mimetype #289

oxinabox opened this issue Feb 20, 2021 · 0 comments

Comments

@oxinabox
Copy link
Contributor

oxinabox commented Feb 20, 2021

Right now we handle the fact that things can define show(::IO, mimetype, ::MyType), vis the MimeWriter
which we list just like any other library. Generally last.

I suggest that we should instead include in the registry a list of mime-types for each filetype.
and then we should have generic code that checks showable for each.
The code in the MimeWriter is basically all the same.
Since the full-full_fidelity IOContext should just be ignored by anything that doesn't know what to do with it;
and listing multiple would achieve the same as else-if that html has.

There is also an argument that these should be at the top of the priority list to try
This is because show is often defined by same library as defines the object.
As such it has the most informatiom about what it wants to do.
Futhermor, it will not normally require loading a dependency.

@oxinabox oxinabox changed the title Falling back to show with mimetype Generalized falling back show + mimetype Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant