-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Expect to see Code cells in Jupyter Outline/ToC #134055
Comments
@chrisdias It's funny, I had the same reaction as you. So the view that I think you (and I expected) to see would be the view if you change this setting from the default: I feel like this might be a conflict between VS Code users expectations and Jupyter users expectations as the classic Jupyter ToC extension and Jupyterlab ToC extension work with headings. But VS Code users might expect what you and I were looking for. I'll bring this up at the next notebook standup, might be worth discussing what the default should be. Right now, it's just for headings. |
I really want to see the outline within the code blocks too rather than each line (if there is one). |
I started this just like @chrisdias wants it to be but got feedback that code-cell in outline are to noisy. I am fine changing it either way. We could also experiment with retrieving the "real" symbol-based outline and add that into the tree |
+1 on seeing what the "real" symbol-based outline would look like. |
Problem with "real" symbols is that notebook code cells are often just variables and expressions and those traditionally don't show in outlines |
+1 on code outline. It does look messy with the code, but maybe there's a way to detect language too? Then use the language's icon for the code? |
I'm for just markdowns, when going through a TOC for a document/article/book, i don't expect to see code, i haven't seen that. See here below for an example (seeing the code will make little to no sense to me, the related heading is what's important & not the code) Even if the first line was displayed, it would not help me. |
The problem I see is there are many places where we can show code cells: breadcrumbs, symbol viewer, and outline. If we decide to not show code cells in the outline then we should think about whether it makes sense to not show it in those other areas as well (for consistency). I actually don’t know how many notebook users would leverage those other features. Would also love for an outline filter option from the view (similar to our other filters). |
Agreed, I don't use breadcrumbs in nbs at all, but use it in regular code files
Sounds like a great idea |
If we're trying to decide whether to keep code-cells off in the outline view by default, then I think the answer right now is yes. I mean, the code-cell visualizations in breadcrumbs, symbol viewer and outline feel "messy" and not particularly useful. Breadcrumbs, Symbols, and Outline view were designed to show where symbols are first defined in a source file. That's not how we're using it here. To add some additional color, I wish I could navigate my source file via the markdown comments in the Interactive Experience. As it stands now, I feel like we're mixing use-cases here and that's what's causing the hangups. In other words, it seems like we need to gracefully incorporate "comment-based navigation" to the Outline View and Breadcrumbs. Symbols should stay only symbols, imo. In general, code files are typically structured around the code itself. Notebooks are structured around a task that isn't necessarily logically codified than by anything other than comments that break the task into conceptual pieces defined by the author. I'm not sure I'm making much sense here, but I think there's a thread that needs to be pulled a bit more. So I'm going to commit this comment and wait so see what people think. :) |
@jglwiz Currently the first line of a code cell is the label for code cell entries within the outline view. If you aren't seeing code cells in the outline view, enabling the setting |
Going to close this as completed as it looks like over time a lot of this has been addressed. The current state of things are as follows:
There is also current work going on to let users control whether or not they will see standard markdown cells in the outline, or if only header information should be shown. That progress along with other nb outline view polish can be tracked via #206308 |
Testing #133901
I expected to see Code cells in the ToC/Outline, like I do when I bring up the outline through the command palette.
To bring up the Outline via the command palette, press
F1
then type in@
. Note the differences in the content with the Outline view.Part of the confusion for me was that initially I didn't have any markdown (despite the instructions to test... who reads the manual ??) , just code and output, then the Outline view is empty and looks broken.
The text was updated successfully, but these errors were encountered: