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

Be able to save a notebook without saving output #9514

Closed
rchiodo opened this issue Mar 28, 2022 · 4 comments
Closed

Be able to save a notebook without saving output #9514

rchiodo opened this issue Mar 28, 2022 · 4 comments
Labels
feature-request Request for new features or functionality notebook-output

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Mar 28, 2022

It was 1 liner since I used Git and VS Code on it.
Any way to restore the indention as you described?

Maybe add an option to auto do it on save? As this 1 line mode make it Git unfriendly.

By the way, it would be also great to have "Save without Output on HD" mode (Git friendly save mode).

Originally posted by @RoyiAvital in #9491 (comment)

@rchiodo
Copy link
Contributor Author

rchiodo commented Mar 28, 2022

This is really a vscode core thing.

@luca-ferreri
Copy link

this could be very useful, particularly when we are handling sensitive info that we don't want to commit on git repos.

@ellisonch
Copy link

ellisonch commented Mar 31, 2022

I am also looking for a way to do this. I wanted to switch to using VS Code to work on jupyter notebooks, but I can't figure out an automatic way to get the nice .Rmd files I'm used to. I never want to put generated output into version control.

Previously, with normal jupyter notebook, I used jupytext to make nice files for version control. I added two lines to my jupyter config:

c.NotebookApp.contents_manager_class="jupytext.TextFileContentsManager"
c.ContentsManager.default_jupytext_formats = ".ipynb,.Rmd"

and everything magically works. The output and all the nasty json gets saved in the .ipynb file, which I .gitignore, while a human readable (and sanely version controllable) .Rmd file gets created automatically. I'd like this inside VS Code.

Aside: I tried, just as a workaround, to use a "run on save" extension in VS Code, in order to automatically convert my .ipynb every time I hit "save"... but it looks like the VS Code notebook interface isn't firing the right events for "run on save" extensions to work right (microsoft/vscode#130799). The extensions can't detect that a save occurred.

Is there any way to do this with VS Code, even with workarounds?

@greazer greazer added feature-request Request for new features or functionality and removed enhancement labels May 4, 2022
@rebornix
Copy link
Member

Let's track in upstream issue microsoft/vscode#124551

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality notebook-output
Projects
None yet
Development

No branches or pull requests

5 participants