feat: static rendering - #67
Conversation
|
@martinRenou @Yahiewi could you test this PR using instruction in the readme here. The |
|
It seems to work nicely! I like the approach. Of course, |
| </button> | ||
| <button | ||
| className="jp-mod-styled jp-mod-accept" | ||
| onClick={createSnapshot} |
There was a problem hiding this comment.
We may want to warn the user that anything that is callback-based will not work in pre-rendered notebooks. Through a tooltip or confirmation dialog
There was a problem hiding this comment.
I've been testing and it works great for me. I have a few comments:
-It appears that when you click 'Save Cache', static rendering is automatically turned on next time you open the notebook. Wouldn't it be better to have a toggle between static rendering and kernel rendering because users may want to save cache but keep using the kernel?
-I agree with @martinRenou that we should have a warning if our notebook contains interactive widgets. We could have a confirmation dialog when selecting 'render statically' (or 'Save cache' as it is now) or we could also simply have a warning in the specta menu (maybe a little '?' icon to the right of 'Static rendering: On/Off').
|
Thanks for the feedback. I wanted to get the rendering mechanism part in first and address the QoLs later |
indeed, i will add another example for static rendering |
Static Rendering
By default Specta starts a kernel and re-executes the notebook every time a reader opens it. If the interactive features of the notebook are not important, you can save time and bandwidth by using the static rendering mode
Static rendering removes the kernel from the rendering process. You execute the notebook once while authoring and save a render cache: the outputs, plus the state of any
ipywidgetsin the document, are stored inside the notebook itself. When a reader later opens that notebook, Specta rebuilds the rendered document directly from the cache and never starts a kernel.