-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add support for VSCode plot pane display. #48
base: master
Are you sure you want to change the base?
Conversation
I don't understand why overloading @davidanthoff and @pfitzseb, how do you feel about LaTeXStrings using MathJax for display like this? (What do you do for rendering equations in Julia Markdown?) |
I have not yet figured out why but
Does not do what I think it should. It enables the mime and ensures that the plot pane is used but it ignores the function body and prints the latexstring rather than my friendly greeting. I have other overloads of |
I have so far always thought of the plot pane in VS Code as being for plots specifically, and nothing else, in particular not as a generic rich display. Not sure whether that really makes sense, but that has been the philosophy so far. So right now we only show MIME types that we think fall into the plot category, namely these. Markdown for example is not part of that list. We do display help markdown in the extension and use katex for the math in that, but that is completely distinct from the We try pretty hard to make as much stuff work in offline scenarios in the extension, and the way this PR here is implemented would presumably only work online, because it doesn't ship mathjax, but downloads it from the web. I think with the current architecture we have there is no way to handle this differently, though, for stuff that comes in via our own MIME type... I definitely think this should work with So I think from my end the biggest question is whether it is a good UI experience when equations show up in a plot pane... We could also think about another possibility: right now the extension displays MIME types that we categorize as "plots" right away in the plot pane. But for tabular sources we don't hook into the display system by default, instead we provide an option that one can do |
I think it would be a good UI experience to have the equations rendered somewhere but I'm not wedded to the plot pane. Latexify already has a function I had not thought about the offline problem and I agree that having the call to Having infrastructure for better rich display support would be nice overall. Displaying markdown and general HTML would be nice! Is there anything keeping us from going all out and adding CSS and javascript support too - allowing for reactive applications? I don't quite see why such a mode of display would be separate from what's currently the plot pane though. Dispatching different display types to different window panes seems a little bit odd to me. I think that the natural classification for determining which pane to use is not from the type of object but rather in the mode of user interaction (documentation lookup, variable inspection, rich display, REPL, file navigation, etc.). With that frame of mind, I make out little difference between a plot and a rendered HTML page (which might include plots). So, I see three paths:
I have a slight preference for 1. but I'm open to any of these options. |
This PR would allow for a no-additional-dependencies way of getting
LaTeXStrings
rendered in the VSCode plot pane - if that is something you'd want to support.I get that you are not interested in supporting rendering through lots of external dependencies (#43) and I agree with that. This suggestion is quite a bit lighter than that though - enable HTML display and prepend mathjax import to the string.
I submitted a PR rather than an issue since that more clearly demonstrates what I had in mind. I'm overloading
Base.repr
because VSCodeServer.jl seems to ignore theBase.show
overload that I started with. If you decide that this VSCode rendering functionality is worth having and that overloadingBase.repr
is strange, then I could have a chat with the VSCode people to see whether we should fix things such that LaTeXStrings.jl could overloadshow
instead.Anyways, it works as it is now if you want to check it out.
Cheers!