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

Support inline html output #764

Merged
merged 2 commits into from
Aug 13, 2018
Merged

Support inline html output #764

merged 2 commits into from
Aug 13, 2018

Conversation

JackDunnNZ
Copy link
Contributor

As suggested in #728 (comment)

I'm unsure about the best order of the various outputs, but if text/html is being used for interactive graphics it should probably come ahead of static images in case both are supported.

@mortenpi mortenpi added this to the 0.20.0 milestone Jul 23, 2018
@mortenpi
Copy link
Member

Thanks! I think this is a good thing to have, although I am wondering if this should be an opt-in? Is there a case where you might want to show text/plain instead of text/html, even if it has a corresponding show method defined?

  • As for the ordering -- text/html should be the very first one, I guess? E.g. for interactive plots. Also, I believe Jupyter/IJulia has this hierarchy somewhere defined as well, so it might be a good idea to be consistent with them.
  • There should be a test for this in test/examples/. You can look at Capture PNG output in addition to SVG #738 / Add inline WebP/GIF/JPEG images #759 to see how it was done for the other formats. Some simple SVG+HTML+JS combo might be best as a proof of concept.

@JackDunnNZ
Copy link
Contributor Author

Yeah, I am not sure about the overall organization and fallbacks etc, your opinion would be useful. I think IJulia asks you to use display to show a different mime, so maybe that is a good approach to take here, i.e. finishing the block with

display("text/plain", x)  # hide

I have updated to match the ordering in IJulia as listed here

Also added a simple example SVG with some JS interactivity

@fredrikekre
Copy link
Member

I think this is fine, most objects does not define a show for html anyway, and those who do probably want them to be used.

@mortenpi
Copy link
Member

Agreed. If there are some corner cases, we can deal with them then.

@mortenpi mortenpi merged commit 61a3ae2 into JuliaDocs:master Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants