Creating a collapsible heading extension

I’ve really enjoyed a lot of the improvements that JupyterLab added over the more conventional notebooks; however, I’ve been slow to adopt JupyterLab as my main notebook frontend due to the still limited number of extensions available. The extension that I miss the most is collapsible_headings which really helps to manage large notebooks. I’ve tried using the TOC extension, but that hasn’t fully filled the void. So, I’ve started to create a collapsible headings extension for JupyterLab.

I am basing the framework for this extension on the original notebook implementation; however, it isn’t always clear to me how to handle this transition. I’ve been able to implement methods to identify header cells and to manipulate metadata, but actually implementing the collapse philosophy is a little lost on me. The original extension directly manipulates the javascript to incorporate event handling, css modifications, etc, which seems to be what JupyterLab is trying to get away from. I took a look into the input/output cell collapse functionality build into JupyterLab, but haven’t figured out how to translate that into manipulating groups of cells denoted by headings.

Anyone have any thoughts on the best way to approach this?

1 Like

You may use this: https://github.com/aquirdTurtle/Collapsible_Headings

1 Like