MiniQuark
MiniQuark

Reputation: 48436

How can I easily edit a Jupyter notebook's JSON code in VS Code?

I have a Jupyter notebook and I would like to directly edit its JSON code in VS Code. However, when I open the notebook, VS Code goes in "Jupyter" mode instead of showing me the actual JSON code.

My current workaround is to rename the file to .json, edit it, save it, then rename it back to .ipynb. That's not very convenient. Is there a better way?

Upvotes: 6

Views: 4210

Answers (2)

Abidi Mohamed
Abidi Mohamed

Reputation: 783

You can use VS Code Jupyter Notebook Previewer Extension in vs code.

Link : https://marketplace.visualstudio.com/items?itemName=jithurjacob.nbpreviewer

Upvotes: 0

Left panel -> Find your file -> Right Click -> Open With... -> Select "Text Editor"

You can then enable syntax highlighting by going in the bottom right, and selecting the right type for the file contents (in your particular case, it's JSON.)

Upvotes: 5

Related Questions