-
-
Notifications
You must be signed in to change notification settings - Fork 322
Implement @skip_as_script functionality inside cell metadata #2018
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
Conversation
Try this Pull Request!Open Julia and type: julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/disberd/Pluto.jl", rev="metadata-exclusive")
julia> using Pluto |
|
The implementation looks pretty neat, the metadata system seems quite powerful! Any idea why the tests are failing? |
|
I think there was one test where a cell was specifically created programmatically without the new |
For cell disabling / enabling, the cell is currently always re-executed. If the cell is disabled, this does nothing, except disabling all dependent cells. If a cell is enabled, running the cell brings the notebook back into a valid state. But for your use case I agree that the metadata should be updated without re-running the cell. |
This comment was marked as resolved.
This comment was marked as resolved.
|
@fonsp I think this is now ready for review. I did not change the visual aspect of it from the beginning as I have no nice idea on how to improve it nor much bandwidth do it in the next days. |
|
I've just tried this and this is what happened.
Screen.Recording.2022-06-10.at.16.20.14.mov |
|
It would be really nice if skip as script automatically propagates to dependent cells. That way one could skip Or if you create some test dataset, you only need to skip the cell that defines it, to remove all your tests. |
This is another issue not related to this PR, see #2167 |
|
@greimel Thanks for trying this out. I'll try out to see what is tue problem causing issue 1. (Though the idea with @fonsp was to merge the basic functionality and probably avoid having a context menu item for the moment, moving the front-end api for skipped cells to a subsequent PR) Regarding the additional functionality it does seem interesting but I think it would need some more discussion to check whether we are not risk hitting some corner cases where you wouldn't want to skip cells automatically. |
Co-authored-by: Paul Berg <naydex.mc+github@gmail.com>
|
The failed test on the Reload from file is quite weird. It only fails on windows 1.7 and I can't understand why. |
|
The tests are sometimes failing because they are timing sensitive, nothing related with the PR! 🙌 It looks great! What has been decided about styling/hiding the button for now (mentioned here) ? |
|
I think @fonsp still didn't have the chance to think what to do about it. You have seen the piece of parchment TODO list during yesterday's call :D |
|
Awesome! My main changes were: renaming to "Disable in file" and changing the wording of the hover title help adding a popup when you click the mysterious new line next to a cell to explain what's up With these changes, I feel like the feature (while still niche) is not too intimidating anymore! So let's just release it publicly for now, instead of adding a secret switch somewhere to enable it. |
|
Thanks a lot @fonsp! Definitely look nicer now! |


First attempt to implement the functionality of the
@skip_as_scriptmacro directly within the cell metadata in the notebook file.Being able to comment out cells in the file without the need of te
@skip_as_scriptmacro is quite useful especially when developing packages with Pluto notebooks as basis.I currently have one problem with the context menu button to toggle the skip_as_script functionality.
I tried copying the functionality from the disabled cell toggle from @lungben, but it seems the change in the metadata for the cell is only correctly registered by the front end after re-running the cell.
This is not ideal as this flag would not need re-running cell for its functionality, but I left the re-run in the added code till I get some help or understand how to toggle this without rerunning.
Maybe some feedback on this from @fonsp or @pankgeorg?