Created
March 12, 2021 18:07
-
-
Save yinleon/eba1def44422e872f651061df083ac8f to your computer and use it in GitHub Desktop.
Thie code snippet allows you to read the markdown cells in Jupyter notebooks and prints them. This should help when you want to spellcheck and vet the text.
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
import json | |
fn = 'notebook.ipynb' | |
notebook = json.load(open(fn)) | |
notebook.keys() | |
for cell in notebook['cells']: | |
if cell['cell_type'] == "markdown": | |
for sent in cell['source']: | |
if sent == '\n': | |
continue | |
print(sent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can copy the output into notion and it'll format it in correct markdown ;)