-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
saving / loading disable status of cells #1209
Conversation
Is hiding the |
I have not changed the way how deactivated cells look in the frontend. |
🛑 is a unicode symbol, it seems that your editor or font does not support it (it works for me in VSCode). |
With a94685f, the symbols are visible, thanks ! # ╔═╡ d5c3ed28-8854-4381-bcf3-9f764af94643
#= ╠═ disabled ═╣
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
╠═ disabled ═╣ =# Just in case it would be an overlook, I find it a bit cleaner with the tee aligned vertically # ╔═╡ d5c3ed28-8854-4381-bcf3-9f764af94643
#=╠═╡ disabled
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
╠═╡ disabled =# Otherwise, disable/re-enable dependent cells works as expected. Good: if someone mess with the comments in the file, by inadvertence, Up to now it looks robust 🙂. |
Thanks, is corrected. |
In the file, there are two empty lines after a disabled cell, but only one for enabled cells. Current PR works, but it might be nice to have a consistent layout, While at it: why not include the trailing |
Good catch, is corrected! |
@fonsp from my side this PR is ready for merging now. |
This comment has been minimized.
This comment has been minimized.
Thanks! Since this is a (non-breaking) file change, I would like to wait a bit before merging. I would also like to see more feedback on the disabling feature. One thought is that we might need to better communicate "disabled cells" when opening a notebook, since the feature will now be exposed to people who have never used Pluto before and opened someone else's file. |
Maybe show a popup window, similar to the undo window for cell deletion, when at least one cell is deactivated? A bit off-topic, but a keyboard shortcut for toggeling the current cell between enabled and disabled would be helpful, too. |
Another small point: currently, if a cell with a higher |
That's a valid concern, but I'd rather disable only cells that are known for sure to error due to the disable, |
For these parts I would need help from a JS expert. |
Those popups are perhaps useful for deletion that otherwise would be irreversible,
Would be nice, but quite separate indeed. |
I think we should:
|
Done |
|
@pankgeorg |
Heyyy, I have another request here: Can we wait with this until we have a more generic way to store extra metadata with cells? OR??? Let a disabled cell be a cell that is commented out fully?
Inside cell: Control a + Control /
Not focussed on a cell: Control a + Control / Pros:
Cons:
Now I'm looking over it I might make this a bit more complex than it need to be... Maybe merge this first (with proper TOML-cell-config) and then look into something more fancy |
That is already the case with this PR, in the .jl file # ╔═╡ d5c3ed28-8854-4381-bcf3-9f764af94643
#=╠═╡ disabled
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
╠═╡ disabled =# But I find it good that it is only dimmed out in the Pluto display, Conversely, if you merely comment out the cell content, as I understand your suggestion, then
Reading again, it looks like you figured that out in the end, so please take this only as a clarification for others. |
I'm so not used to seeing
Yeah!! Visually, very much!! I'm thinking more the other way, so when you select a whole cell and comment it out, it becomes disabled and dimmed. I like the dimmed version way better than this huge pink block of comments :P
Yeah... 😅 Thanks! # ╔═╡ d5c3ed28-8854-4381-bcf3-9f764af94643
# ╠═╡ disabled = true
#=
sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8)
=# or # ╔═╡ d5c3ed28-8854-4381-bcf3-9f764af94643
# ╠═╡ disabled = true
# sol = solve(prob, Tsit5(), reltol=1e-8, abstol=1e-8) |
Another cool emergent feature of cell disabling is that you can use variables defined in a disabled cell in a new cell without an error, the new cell gets automatically disabled. I like the idea of using TOML meta-data! Regarding commenting out by line (with |
Where does this PR stand in terms of getting merged? I'm working on using Pluto to create assignments and being able to disable cells which the students must modify before they will work, or cells which will run for an extremely long time is a really nice feature I was hoping to use. I didn't realize the disabledness state doesn't currently get saved. |
The issue is that this PR would change/enhance the Pluto file format, which is not reversible (however, the change is backward-compatible). Thus, if #1482 should be introduced, it is better to do it before this PR and store the cell disabling status in that new metadata. |
Since this is stalled anyway, here is an answer to #1209 (comment): Prepending With the nice toml idea #421 or #1482 it would be tempting to add a
Yet it's true that executing a |
@lungben For the "prepend |
How to proceed here:
|
This functionality is implemented in #1895, closing this PR now. |
implements #1205