-
Notifications
You must be signed in to change notification settings - Fork 388
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
Visual studio extension for Jupytext #143
Comments
Hello @tribbloid , thanks for reaching out. That is an interesting question, and I also would like to be able to update both the script and notebook within other editors than Jupyter Notebook or Lab. One question: have you contacted the authors of VSNotebooks, either from the fork you cite, or from the original repo? I think such an extension has to be coded in Javascript, and I have no experience in that language yet. |
Many people have posted on his issue tracker so far but evidently he is busy with something else. I'll try to understand his sourcecode and see if I can take over, I don't write Javascript either but fortunately Scala.js (one of my favourite language) has full interoperability with it. |
@mwouts sorry he is already trying to fix it, this is the thread: |
interested in this as well. The VS code previewer is fixed now. I can use it normally with Ubuntu 16.04 today. |
What's the current state of this? We just would need to find a way to open non-ipynb files with the extension and pipe everything through jupytext on every load/save. I don't think this can be hard, I just don't have any experience with vscode extensions. |
Is there any progress on integrating |
Looks like this is an ongoing attempt to make it possible: https://github.com/notebookPowerTools/vscode-jupytext |
Hi @DonJayamanne, your vscode extension looks great! |
I'm happy to kill that extension in favor of an official extension from jupytext itself. We could either start now, or wait and see how popular my current VSCode extension gets and learn from it's mistakes. I know there are a few issues with that implementing. |
Hi @DonJayamanne , it's great to see you working on this! (BTW I was much impressed already by your PythonVSCode extension 👍 ) Well to start with I'll be happy to add a pointer to your extension in the documentation when you feel ready for that. Also let us know if you need dedicated commands (from https://github.com/notebookPowerTools/vscode-jupytext/blob/main/src/conversion.ts it seems that you are using Last but not least, I am wondering if it would make sense to develop a TypeScript implementation of Jupytext, for at least the percents formats (this could also be useful in the context of JupyterLab, cf. #381). What is your opinion on this? (NB: I know too little TS at the moment, but I'd be glad to learn!) |
Thanks,
Didn't want to go with Sync, because I don't think users really want an ipynb file, i think they just want to use the notebook UI. But thats my assumption. I'm happy to look into the sync option. Right now what i do is create an ipynb & use a virtual file system, when the notebook is saved in the virtual file system, then i save the file in *.py. I.e. there's no real ipynb file on disc. I could look into the sync option, I think I just might end up going down that path, as the virtual file system has its own issues (relative paths to images in markdowns might not work).
For non python files, my plan is most definitely to use typescript.
I figured, if someone wants to open Python files, then they'd already have Python installed. However if Python isn't installed, then yes the plan is to go with TypeScript, however my concern there was, thats a lot of code, supporting myst, sphynx (metadata, etc), that's a lot, & ensuring the conversion from Python to IPYNB & back to Python should be accurate, else we could have unnecessary changes that show up in SCM.
Thanks, I would like to treat this as an exploratory extension. lets see what users really want from such an extension & what are the issues with this implementation.
I'm planning on adding some telemetry to see if users have any metadata & the like in the plain text files. This will give an idea of the amount of work required in writing the typescript version of the parser. |
I'd actually want to have 3 options:
I think those options cover all. |
Please upvote this issue microsoft/vscode-jupyter#4670 |
Just curious and following up: What's the status on discussion of a VSCode extension? I'm aware of @DonJayamanne's extension, but it seems to only be Insiders. As a VSCodium user it would be really great to have such an extension, but I assume that having a stable VSCode extension is a prerequisite. |
This is extension is great, but unfortunately it hasn't been updated in a while. I think jupytext is essential when you work with other people on the same notebook. Synching .ipynb via git is a nightmare, but .py are really easy to handle. I hope that there'll be some official jupytext-support for VCode in the upcoming releases. |
A variation of the idea is proposed in microsoft/vscode-jupyter#9514. |
I would love to see this become a reality. Fingers crossed 🤞 |
For users that want to save the output as well, having the .ipynb file as well seems like a good option, and they can just exclude it from version control and use the .py file for that, so they get the best of both. It's also helpful when the .ipynb file is the main format they share across different platforms to enable viewing and editing wherever generating a notebook from the .py file isn't supported. If you do choose to add this then I recommend making it configurable so users can choose to use |
Also see microsoft/vscode-jupyter#1240 |
VSCode 1.79 added the |
Is there anything for |
Hey, I see that a |
I've been toying with this and found that with the run on save extension and this in your settings: "emeraldwalk.runonsave": {
"commands": [
{
"match": "\\.(ipynb|jl|py)$",
"cmd": "jupytext --sync '${file}'",
}
]
} you're alot of the way to functioning Jupytext in VSCode. You do need to initially pair your notebook via the CLI if its not already. I imagine it wouldn't be too hard too hard to add this and the rest of the Jupytext UI in some simple extension. In any case I think this means the API you need has to be there. screencast.webm |
May I know the status of this ? I found 2 JupyText extension for VS Code but I don't know which one to use and what are their differences: https://marketplace.visualstudio.com/items?itemName=donjayamanne.vscode-jupytext https://marketplace.visualstudio.com/items?itemName=congyiwu.vscode-jupytext |
Continuing to mess around, I wrote a new extension that basically just Open to any feedback I could potentially publish this too. |
@marius311 I tried your extension and the command that it tries to run is fine but it can't find jupytext in my venv. I get the following error. It seems that it's running outside of my venv although it is activated in VSCode.
But in my venv jupytext is installed:
|
For now it doesn't do any detection of environment, but the extension provides a setting to point directly to the jupytext executable, try setting that to |
This feature aims to combine Jupytext with features from the following 2 extensions:
The extension will become effective immediately after opening any .lgt.py file, on initialisation it will create a companion & hidden .ipynb under the same directory(thus avoided breaking relative path references).
The plugin should attempt to synchronise 2 files on save or when ''Run cell' command is invoked.
In later case the extension should also submit the updated cell to the backend ipython server, update the output section of the ipynb file, and display/refresh the nbreviewer.
The above is just what I would perceived as the default behaviour, this allows any user to start writing a python file like a latex document, and compile into python notebook, as well as all document supported by nbconvert in real time, and without any installation or configurations
The text was updated successfully, but these errors were encountered: