-
Notifications
You must be signed in to change notification settings - Fork 805
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #814 from jcb91/init_cell
[init_cell] updates
- Loading branch information
Showing
3 changed files
with
126 additions
and
29 deletions.
There are no files selected for viewing
38 changes: 36 additions & 2 deletions
38
src/jupyter_contrib_nbextensions/nbextensions/init_cell/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,39 @@ | ||
init_cell | ||
========= | ||
|
||
Add a cell toolbar selector to mark cells as 'initialization' cells. | ||
Such initialization cells are run on notebook load, or on clicking the provided button in the main toolbar. | ||
Add a cell toolbar selector to mark cells as 'initialization' cells . | ||
Such initialization cells are run: | ||
|
||
* on clicking the provided button in the main toolbar | ||
![main toolabr button](icon.png) | ||
* by default, on kernel ready notification for trusted notebooks. | ||
This is configurable (see options section). | ||
In untrusted notebooks, a warning is displayed if the cells would otherwise | ||
have been run. | ||
|
||
|
||
Options | ||
------- | ||
|
||
This nbextension provides option configurable using the | ||
[jupyter_nbextensions_configurator](https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator). | ||
|
||
The running of initialization cells on kernel ready notification can be | ||
frustrating if your kernel is attached to multiple frontends, or is persistent | ||
between frontend reloads (e.g. reloading the notebook browser page without | ||
killing the kernel). | ||
As such, the option `init_cell.run_on_kernel_ready` in the notebook config | ||
section controls whether this behaviour occurs. | ||
The server's config value can also be overridden on a per-notebook basis by | ||
setting `notebook.metadata.init_cell.run_on_kernel_ready`. | ||
|
||
|
||
Internals | ||
--------- | ||
|
||
Cells are marked as initialization cells in their metadata, as | ||
|
||
cell.metadata.init_cell = true | ||
|
||
The running of initialization cells on kernel ready is bound to the Jupyter | ||
event `kernel_ready.Kernel`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters