Last active
May 13, 2024 08:17
-
-
Save ruslanmv/74f09769d18b244909158712a341ff6f to your computer and use it in GitHub Desktop.
Saving the Notebook to markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install "notebook<7" | |
### Saving the Notebook to markdown | |
import IPython | |
#from IPython.lib import kernel | |
from ipykernel.kernelbase import Kernel | |
%%javascript | |
var kernel = IPython.notebook.kernel; | |
var thename = window.document.getElementById("notebook_name").innerHTML; | |
var command = "theNotebook = " + "'"+thename+"'"; | |
kernel.execute(command); | |
import os | |
command_convert="jupyter nbconvert " | |
command_in=theNotebook+".ipynb" | |
command_out=theNotebook+".md" | |
command_action=" --to markdown --output " | |
command=command_convert+command_in+command_action+command_out | |
print(command) | |
os.system(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
adding version