How to convert ipynb file into txt or a markdown file where the JSON of the notebook file is wrapped in a code block?
I have a file ipynb which i want to convert into markdown or plain txt file. I create the file using vscode IDE. I don’t see export to txt or md option. I have jupyter extension installed in vscode.
3
Answers
Open your ipynb file with
Text Editor
in Linux or withNotepad
in Windows.Then you will see a json like file. You can save it as txt file.
You can view the textual JSON contents of Jupyter Notebooks in VS Code by using the
View: Reopen Editor With Text Editor
command in the command palette. If you want to create a markdown file containing that JSON wrapped in a code block, the just select all the JSON contents from the text view, then create a markdown file with a code block, and paste the contents of the file into that code block.In terminal, go to the directory with the notebook, and run
It will open a page in a browser. Open your notebook. Under
File
in the top left, you can export your notebook into various formats.