This extension enables to execute cells contained in a collapsed heading section with one click, and view a summary of hidden outputs.
Successfully executed cells are frozen automatically to prevent to re-run.
- Jupyter Lab >= 4.0.0
- Collapsible Headings extension is installed and enabled
Install the python package
$ pip install git+https://github.com/NII-cloud-operation/Jupyter-LC_run_through
Install and enable this extension and enable required extensions
$ jupyter run-through quick-setup
Disable and uninstall this extension
$ jupyter run-through quick-remove
The extension uses latest(test with 4.7.0) Font Awesome icons. If you use Jupyter Notebook Server 5.0.0 or earlier, you should update Font Awesome as follows:
-
Retrieve the notebook installed path
$ find /usr -name FontAwesome.otf | grep notebook /usr/local/lib/python2.7/dist-packages/notebook/static/components/font-awesome/fonts/FontAwesome.otf -
Download and Update Font Awesome
cd /tmp/ curl -O http://fontawesome.io/assets/font-awesome-4.7.0.zip unzip font-awesome-4.7.0.zip cp font-awesome-4.7.0/fonts/* /usr/local/lib/python2.7/dist-packages/notebook/static/components/font-awesome/fonts/
Any markdown heading cell (that is, one which begins with 1-6 # characters), becomes collapsible once rendered.
Please see readme.md of Collapsible Headings about details.
The run-through button and summary of outputs appear in a collapsed heading cell.
The code cells which are collapsed appear as colored bricks. The colors mean as follows:
- Gray: Not Executed
- Green: Successfully Executed
- Pink: Failed
A brick with a snowflake means it is Frozen cell as below.
The extension provides Lock(make the cell read only) and Freeze(prevent re-execution) functions like Freeze extention , but also allows to control the Locked(Read Only) and Frozen states separately.
When the extension is enabled, the buttons below appear on the toolbar.
For the Locked(Read Only) state:
- Make selected cells read-only
- Make selected cells editable
For the Frozen state:
- Freeze selected cells
- Unfreeze selected cells
- Unfreeze below in section
- Unfreeze below all
To remove the extension, execute:
pip uninstall lc_run_throughNote: You will need NodeJS to build the extension package.
The jlpm command is JupyterLab's pinned version of
yarn that is installed with JupyterLab. You may use
yarn or npm in lieu of jlpm below.
# Clone the repo to your local environment
# Change directory to the lc_run_through directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm buildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter labWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
By default, the jlpm build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
jupyter lab build --minimize=Falsepip uninstall lc_run_throughIn development mode, you will also need to remove the symlink created by jupyter labextension develop
command. To find its location, you can run jupyter labextension list to figure out where the labextensions
folder is located. Then you can remove the symlink named lc_run_through within that folder.
See RELEASE


