question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TOC for `.py` files with percent markup

See original GitHub issue

I suggest to have a TOC available for .py files with percent markup. I guess for that we’ll need to have the user select which kind of “Outline” view is of interest - the one for regular code files (which will not pickup e.g. markdown cells), or the one adjusted for notebooks.

My use case - in our team we manage a big .py file that acts as a sort of “catalog” of useful and relatively independent cells. This has to go under source control for version management and collaboration. The typical workflow is then to open an Interactive Window and execute a few of the cells of interest. So for finding these cells in the large file the described TOC is useful.

_Originally posted by @syagev in https://github.com/microsoft/vscode-jupyter/issues/1348#issuecomment-814769835_

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
GitHunter0commented, Apr 20, 2021

@DavidKutu , great! A TOC in the Outline pane is incredibly helpful, I miss that feature very much.

Two suggestions if I may:

(1) The hierarchical section system of Spyder IDE seems a good one to implement:

#%% Section
#%%% Subsection
#%%%% Subsubsection
And so on

(2) Since VScode is providing native conversion from .py files to notebooks (.ipynb), it would be nice to have a syntax that allows the user to go back and forth between .py and .ipynb maintaining code sections, markdown sections and TOC intact.

Thank you

2reactions
DavidKutucommented, Apr 19, 2021

Thanks for the request @syagev! We’ll discuss it in an upcoming meeting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TOC for .py files with percent markup · Issue #17218 - GitHub
My use case - in our team we manage a big .py file that acts as a sort of "catalog" of useful and...
Read more >
Table of Contents (TOC) for python files (.py) in VScode - Reddit
Spyder IDE already adopts this standard and VScode already defines sections by `#%%`. Also, in VScode, .py files can do almost anything Jupyter ......
Read more >
Tutorial: Scientific reporting from Jupyterlab with R Markdown
py files with %% cell markup. Jupytext would then faithfully recreate the notebook files when cloned to a new system, and things would...
Read more >
Available lexers - Pygments
Lexers for Python and related languages ... Lexers for semantic web and RDF query languages and markup ... Lexer for World of Warcraft...
Read more >
Images and figures - Jupyter Book
MyST Markdown provides a few different syntaxes for including images in your documents, as explained below. The first is the standard Markdown syntax,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found