Last active
October 25, 2024 21:23
-
-
Save apcamargo/56d60d128c7d3b56e5be056015de8754 to your computer and use it in GitHub Desktop.
Function for viewing Jupyter notebook (`ipynb`) files in the terminal
This file contains hidden or 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
# Requires jupytext (https://github.com/mwouts/jupytext) and Glow (https://github.com/charmbracelet/glow) | |
ipynb-view () { | |
if [ -z "$1" ]; then | |
echo "Usage: ipynb-view <notebook.ipynb>"; | |
return 1; | |
fi; | |
jupytext --from ipynb --to markdown --output - "$1" | glow --preserve-new-lines --pager | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment