5

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?

MiniQuark
  • 46,633
  • 36
  • 147
  • 183
  • 1
    Does this answer your question? [How to view .ipynb as regular text intsead of an ipython notebook in vscode](https://stackoverflow.com/questions/61091264/how-to-view-ipynb-as-regular-text-intsead-of-an-ipython-notebook-in-vscode) – Will Da Silva Jun 24 '21 at 15:20

2 Answers2

3

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.)

0

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

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

Abidi Mohamed
  • 723
  • 7
  • 7