Open mforbes opened 5 months ago
Code only executes if there is a preamble defining the kernels for which code should be executed.
This seems reasonable, along with a clear switch at the top of the editor to turn code execution on and off, probably with the default being "off".
I'm labeling this as "bug" due to "there needs to be some way to disable this".
Actually, the way the UI works right now is not too bad:
```bash {kernel="bash"}
# This will execute
# This will not execute
Perhaps the only change needed is:
* Allow the cell to be execute iff one of the following is true:
* there is a valid`{kernel=}`
* there is a kernel specified for the file in the "preamble" comments (for compatibility with Jupyter book).
* There should be a "no kernel" option or something in the UI that is the default.
Please keep thinking about this!
Here are some general suggestions as I work with code cells (probably should be migrated to a new issue once the execution pattern in established, but I am keeping there here for now.)
Run
button should always rerun the code, invalidating that particular cache. The should also be some way (thought maybe somewhat hidden) to refresh the entire cache.
Workaround: change the code (add a comment for example).
Related: Is there a way to refresh the image cache. (I.e. when viewing a saved image?) Update: This might be a browser-cache related issue, which would need something triggering the browser to reload the file when it changes.(For CoCalc Devs: I am playing here if you want some code.)
Some relevant issues etc.:
While the ability to execute code in a markdown file is awesome, there needs to be some way to disable this. I.e. in usecases like this:
Needless to say, someone should not be able to accidentally execute this cell with shift-enter... but I still want to be able to use code-fences to format code.
Not sure of the best option. Here are some alternatives:
This would break the case where people upload a markdown file and then want to execute cells, but they are all dead. The UI could easily fix this.