Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support collapsible hierarchy of sections #2275

Open
scottdraves opened this issue May 25, 2017 · 19 comments

Comments

@scottdraves
Copy link
Contributor

commented May 25, 2017

Allow users to toggle open/close sections by clicking on some kind of UI element.
This helps with navigating and organizing large notebooks.

@sccolbert

This comment has been minimized.

Copy link
Contributor

commented May 25, 2017

Related issues:
#1742
#713

@afshin afshin added this to the Future milestone May 25, 2017

@scottdraves

This comment has been minimized.

Copy link
Contributor Author

commented May 26, 2017

This might mean more integrated support for sections. Right now, afaik the only way to make them is to create a markdown cell and then type "#". This maybe hard to discover, and also makes them hard to build GUI around them (since they are in the middle of cells). Should sections be their own cell type?

@ellisonbg

This comment has been minimized.

Copy link
Contributor

commented May 28, 2017

@scottdraves

This comment has been minimized.

Copy link
Contributor Author

commented May 29, 2017

totally agree on keeping the data model the same and building improved UI around it (the virtual sections).

@scottdraves

This comment has been minimized.

Copy link
Contributor Author

commented May 29, 2017

Is there an issue already filed for making the markdown editor more GUI, either with a toolbar like github's, or a full on WYSIWYG editor? Isn't there an effort to make this pluggable and Maybe that's where this gui lives?

@ellisonbg ellisonbg changed the title feature suggestion: support collapsible hierarchy of sections Support collapsible hierarchy of sections Aug 17, 2017

@ellisonbg

This comment has been minimized.

Copy link
Contributor

commented Aug 17, 2017

Ran into a need for this working with some large notebooks recently. Would really help a lot.

@aquirdTurtle

This comment has been minimized.

Copy link

commented Oct 10, 2017

This is a really important feature for me. In my lab, we use a single notebook to organize all the data & notes that we collect over the course of a day, and by the end of each day the notebook is quite large. Notebook organization is important enough that I probably need to stick with the plain notebook + the nb_extensions collapsible headers extension until collapsible headers or a TOC is supported in Jupyter lab. Really excited for Jupyter lab though!

@pluviosilla

This comment has been minimized.

Copy link

commented Jan 24, 2018

I find the NB Extensions feature that allows a TOC on the lefthand side invaluable with large notebooks, and all my notebooks tend to get large, because of the way I use this marvelous tool. Unfortunately, after the classic notebook reaches a certain size it starts to time out when loading the Javascript for NB Extensions and MathJax. I am extremely eager to find out whether JupyterLab will offer the same functionality and fix the timing out problem.

This image of the TOC supplied by NB Extensions shows how it makes a complex document much more accessible. My fear is that Jupyterlab developers will be too focused on producing an IDE with lots of new features and that you might sacrifice the qualities of Jupyter that make it suitable for turning programs into documents. I'd rather you focus on getting current features to work better, especially document publishing features that tend to falter as documents grow.

image

@jsmm

This comment has been minimized.

Copy link

commented Feb 24, 2018

There is no way I can orderly write nor browse large notebooks without table of contents. I am also waiting for TOC2 to be ported before moving from Jupyter notebook to lab.

@jasongrout

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2018

My fear is that Jupyterlab developers will be too focused on producing an IDE with lots of new features and that you might sacrifice the qualities of Jupyter that make it suitable for turning programs into documents. I'd rather you focus on getting current features to work better, especially document publishing features that tend to falter as documents grow.

I think that the largest part of our time is spent on making a rock-solid extensible underlying framework so that people can explore this and many other ideas and workflows with extensions.

For example, @ian-r-rose is experimenting right now with building a TOC extension: #3949

@ellisonbg

This comment has been minimized.

Copy link
Contributor

commented Feb 24, 2018

@shgidi

This comment has been minimized.

Copy link

commented May 28, 2018

@cdagnino This issue is about collapsible headers, not about table of contents.

@riemannzetagambit

This comment has been minimized.

Copy link

commented Aug 24, 2018

Are there any branches that are working on this? I'd like to contribute if I can-- I know a number of folks who haven't transitioned over from plain notebooks because of the lack of this feature. I love the other features of jupyterlab too much now to not use it but it's a real pain on any notebook of substance to navigate without collapsible headings.

@ellisonbg

This comment has been minimized.

Copy link
Contributor

commented Aug 25, 2018

@marius311

This comment has been minimized.

Copy link

commented Aug 28, 2018

@ellisonbg Thanks for you guys' work on that, I'm very happy to hear collapsable headers are on the way via that extension, since at the moment its the main drawback of Jupyterlab for me.

As a general point though, as stated above, the question of whether sections/headings within the notebook are collapsible is separate from where the TOC knows about it or can trigger it, right? One could imagine the notebook itself allows collapsible sections independent of TOC behavior, such as how the collapsible_headings plugin works for Jupyter notebook.

@ellisonbg

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2018

@pluviosilla

This comment has been minimized.

Copy link

commented Aug 29, 2018

@jasongrout jasongrout modified the milestone: Future Sep 5, 2018

@watkinrt

This comment has been minimized.

Copy link

commented Jun 3, 2019

Like a couple other comments, the lack of collapsible headings has prevented me from fully switching over to JupyterLab; it is just too hard to manage large documents (even with the TOC extension). For that reason, I started developing a collapsible heading extension based on original notebook extension. I don't want to replicate work if the developers of the TOC extension are going to implement the same feature (especially since they area to be much more sophisticated developers than me), but with no roadmap or timeline, I also don't want to wait around for its development.

I posted a comment on the JupyterLab discussion board regarding development suggestions for this feature, but it looks like this might be a better place to get feedback. As I stated earlier, I'm just trying to transition the original notebook extension to JupyterLab's framework; 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 (although I can't say I fully understand the JupyterLab framework). 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?

@aquirdTurtle

This comment has been minimized.

Copy link

commented Jul 29, 2019

I got a little tired of waiting, so I took the weekend to take a shot at implementing my own collapsible headings extension. The very early version of this is located here. I think the basic collapse functionality is working well, but the UI still leaves a lot to be desired. I haven't figured out how to properly add some sort of clickable widget next to the markdown headers like in the original, so right now you can only collapse the currently selected header with a hotkey (ctrl Q). Any advice on how to add such a ui element to the cells in addition would be very useful.

Demo

This is simultaneously my first attempt at a Jupyterlab extension, as well as my first foray into anything java/typescript or any sort of web-application, so I'm sure the implementation could be better as well. Feedback is very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.