On Monday, March 30, 2020 at 6:48:29 AM UTC-4, Edward K. Ream wrote: > > Thomas Passin and I have been discussing his vr3 plugin in private. This > is a great plugin. Our conversation deserves to be public. > > Here I am going to discuss what I think I know about vr3 and its > relationship with the holoviews <http://holoviews.org/>and bokeh > <https://docs.bokeh.org/en/latest/docs/user_guide.html>packages. I'll > keep this as short as possible. > > *vr3: the big picture* > > vr3 allows you to interleave python code with rst, such that *both* parts > are shown in the vr3 pane. This is a great feature. For example, given the > following in the body pane: > > @language python > > import holoviews as hv > hv.extension('bokeh') > xs = range(-10,11) > ys = [100-el**2 for el in xs] > curve = hv.Curve((xs, ys)) > curve.opts(width=350, height=300) > hv.save(curve, 'curve.html') > > @language rest > Here is the resulting interactive graph: > > .. raw:: html > :file: curve.html > > You will see something like the attached file in the vr3 pane. > > I wonder, though, whether some of the rST code is necessary. Thomas, > wouldn't it be simpler (for users) for vr3 to support something like: > > @language rst > Here is the resulting interactive graph: > @image curve.html >
Not in this case, because the output is interactive javascript code, not just an image file. Matplotlib will produce an image file, and then you could probably do it that way. Also, for there to be an @image directive, we'd have to think it through carefully to understand what should happen if someone put one into the middle of a code block. In principle, it would be a good thing to have a language-agnostic directive like this that you could use the same way with both MD and RsT, so the idea is attractive from that point of view. -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/1aae8960-ccd2-4853-94a8-3f7adfb1d105%40googlegroups.com.
