jupyterlab / jupyterlab-toc

Table of Contents extension for JupyterLab
BSD 3-Clause "New" or "Revised" License
728 stars 106 forks source link

Add ability to enable / disable collapsible notebook cells #132

Closed marthacryan closed 4 years ago

marthacryan commented 4 years ago

Patch for #123 to allow users to disable the collapsing cells feature of ToC. Adds a setting in the Jupyter lab setting registry to enable/disable the collapsing feature of ToC in notebooks. Removes the dropdown feature in Toc but leaves the blue side bar, so some collapse behavior is still present. I left the blue side bar to collapse individual cells because I wasn't sure if this part of the collapsing feature was bothering people - I can remove that as well if so.

To try out changing this configuration, open the settings menu of Jupyter lab (shortcut is ⌘ , ) and add the configuration under "User Preferences" like this: image Then, reload the page in your browser and the changes should be visible.

When collapsibleNotebooks is set to false, the extension looks like this: image After clicking the blue side bar: image

Fixes #123

marthacryan commented 4 years ago

Thanks for getting those suggestions in so quickly @kgryte - do these changes look ok?

lresende commented 4 years ago

@kgryte with your latest commit, are we still waiting for any updates to this pr?

kgryte commented 4 years ago

@lresende Approved. Have you had a chance to confirm the intended behavior on your end?

lresende commented 4 years ago

@kgryte Yes, working as expected on my end. Verified that activating configuration it switches back to the old style where sections can become hidden, but, by default that is not the case anymore. Thank you and @marthacryan for getting this resolved.

kgryte commented 4 years ago

@lresende As this is a breaking change, we'll need to release a new semver major.

lresende commented 4 years ago

OK, but please give me a couple of days as there seem to have an unrelated issue and I want to check tomorrow before a release.

kgryte commented 4 years ago

@lresende No worries. Just wanted to make sure we were on the same page regarding the version bump. :)

billgreenwald commented 4 years ago

Hi all, I was following the post that this fixed; is there a way for me to set the default option to be disable so that everyone in my organization wont accidentally miss anything, or does each individual person need to update this user preference?

kgryte commented 4 years ago

@billgreenwald If you are centrally managing JupyterLab, then you can set plugin configuration options at the command-line upon launching JupyterLab. All users will then have the setting set to your preferred setting on load.

billgreenwald commented 4 years ago

We have a shared conda environment/anaconda install that everyone uses to run jupyterLab, but it lives on an nfs drive that is network mounted to many VMs, each of which runs its own jupyter lab instance. These are accessed via environmentModules, so I can set shared JUPYTER_PATH variables and such to give common access to kernels or plugins.

So I do and i don't have a centrally managed JupyterLab. Is there a way I can configure the extension itself at the install level, or settings from an environment variable? Or set default jupyter command line args to get passed from an environment variable?

I understand this is a very targeted question at my use case and help may not be possible/too specific for this thread. I appreciate all help though :)