Reputation: 135
I use markdown headers to navigate in notebooks but I also tend to make a lot of (non-header) markdown notes. Both show up in the outline which makes finding the right heading quite difficult as notebooks grow large.
Is there a way to suppress plain markdown cells showing up in the outline?
Upvotes: 11
Views: 2330
Reputation: 51223
There's an issue ticket for this in VS Code's GitHub repo at Native Notebooks - Outline (aka Table of Contents or TOC) should only show headers, not plain text #147007.
A change to address this was made in Pull Request Add setting to exclude non-header md cells from notebook outline view #207771. Quoting Yokocrazy's comment in the issue ticket:
The outline view will have a filter icon allowing for easy configuration of the entries you would like to see. There are also the following settings:
"notebook.outline.showCodeCells": boolean
(defaults totrue
)"notebook.outline.showNonHeaderMarkdownCells": boolean
(defaults tofalse
)
The change will be released in the March 2024 milestone (VS Code 1.88). Related release notes are here.
Upvotes: 3
Reputation: 2451
I have followed the discussion on github and at Creating Table of Contents in VS code Jupyter Notebook
the author of one answer was also not satisfied with the outline
feature and created jupyter TOC
extension, and at some point, I also ended up using it. This has an option to exclude text from visualization (I believe it is possible to set maximum expansion level), but I still consider the outline
more desireable, because it stays visible when I scroll the document, which I consider essential.
The workaround I found is to put, when possible, text in the same cell as the header. This makes it easier to keep the outline clean, and just avoiding to expand too much the outline works decently for me, even if it implies some annoying restrictions on the way you structure text. Other than that, it is possible to play with the collapse/expand feature of the outline and get a sufficient control, even if the possibility of completely exclude the text is still a desireable upgrade.
Upvotes: 4