Package: jupyterlab-hidecell
jupyterlab_hidecellJupyterLab extension totag cells so that they have their input, or output, or both, hidden or removedcan replace former 'hide-input' extension in the classic notebookCompliance with Jupyter bookas far as possible we try to make this extension compatible with the tags used by jupyter-book as described here:https://jupyterbook.org/en/stable/interactive/hiding.html#hide-code-cell-contentRequirementsJupyterLab >= 4.0.0Usageto convert your notebooksthat were using the formerhide-inputextension, you can usehideinput-to-hidecellnotebook1..notebookNthat will replace the oldhide_input: truewith the newhide-inputtag in all
notebooks passed as argumentspalette commands and keyboard shortcutsall commands behave as togglers, so that you can use the same shortcut to hide
and show content; search forhidecellin the palette to display:shortcutcommanddescriptionAccel-0 H Ihidecell:toggle-hide-inputinput area is hidden, a visual handle allows to toggle it back onAccel-0 H Ohidecell:toggle-hide-outputsame for outputAccel-0 H Chidecell:toggle-hide-cellsame for whole cellAccel-0 R Ihidecell:toggle-remove-inputinput area is no longer visible at allAccel-0 R Ohidecell:toggle-remove-outputsame for outputAccel-0 R Chidecell:toggle-remove-cellsame for whole cell (vanishes)Accel-0 Nhidecell:debug-onoutline the cells subject to any of our tagsAccel-0 Fhidecell:debug-offquit debug modeother controlssince this exclusively relies on the presence of the above tags, you can also
use jupyterlab's so called "Property Inspector" feature; however in this case
you're in charge of avoiding duplicate tags...limitationsrendering is exclusively done in CSS; converting to a non-HTML format will ruin
this layoutInstallTo install the extension, execute:pipinstalljupyterlab-hidecellUninstallTo remove the extension, execute:pipuninstalljupyterlab-hidecellDevelopment installWARNINGfrom this point on, this is the boilerplate text that comes with
the extension cookie-cutter template; it is not guaranteed to be accurateNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jupyterlab_hidecell directory# Install package in development modepipinstall-e"."# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmbuildYou 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 neededjlpmwatch# Run JupyterLab in another terminaljupyterlabWith 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, thejlpm buildcommand 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:jupyterlabbuild--minimize=FalseDevelopment uninstallpipuninstalljupyterlab-hidecellIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is
located. Then you can remove the symlink namedjupyterlab-hidecellwithin
that folder.Packaging the extensionSeeRELEASE