Skip to content

Instantly share code, notes, and snippets.

@apcamargo
Last active October 25, 2024 21:23
Show Gist options
  • Save apcamargo/56d60d128c7d3b56e5be056015de8754 to your computer and use it in GitHub Desktop.
Save apcamargo/56d60d128c7d3b56e5be056015de8754 to your computer and use it in GitHub Desktop.
Function for viewing Jupyter notebook (`ipynb`) files in the terminal
# 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