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

Adding a command and shortcut for jupyter.changeCellToRaw #15683

Open
maximecharriere opened this issue May 10, 2024 · 2 comments
Open

Adding a command and shortcut for jupyter.changeCellToRaw #15683

maximecharriere opened this issue May 10, 2024 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality

Comments

@maximecharriere
Copy link

In Jupyter Notebook, when selecting a cell, you can press esc + r to transforme the cell from Python to Raw. This is particularly useful for disabling a cell, so that it doesn't execute when you choose "Execute all" or "Execute above cells".
See this question for more info: https://stackoverflow.com/questions/34192290/ipython-notebook-elegant-way-of-turning-off-part-of-cells

In VSCode, jupyter.changeCellToCode (esc+c) and jupyter.changeCellToMarkdown (esc+m) are already present, but not jupyter.changeCellToRaw (esc+r).

Would it be possible to add this command and corresponding shortcut?
If I propose a PR, will it be accepted?

@maximecharriere maximecharriere added the feature-request Request for new features or functionality label May 10, 2024
@amunger
Copy link
Contributor

amunger commented May 10, 2024

Doesn't changing to markdown accomplish this same thing?

@maximecharriere
Copy link
Author

Technically, yes, but it's not the most convenient.
In the following screenshot you have 3 times the same cell, but as a Python, Raw, and Markdown format.

  • The first cell is executed if I maj+enter, Execute all or Execute above cells, which I don't want.
  • The second still has a "code" style, but the cell is deactivated and will not execute the Python code.
  • In the third one, the code will also not run, but it has a markdown style, resulting in a messy notebook. The comments in code will be interpreted has H1 header, everything will be on one line, and we will not see the difference between a real Markdown cell and a deactivated code cell.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants