Skip to content

Instantly share code, notes, and snippets.

@DahlitzFlorian
Created February 25, 2018 17:38
Show Gist options
  • Select an option

  • Save DahlitzFlorian/03699c8aa2f015528807507c6dec0f97 to your computer and use it in GitHub Desktop.

Select an option

Save DahlitzFlorian/03699c8aa2f015528807507c6dec0f97 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ "$1" == "-r" ]
then
LANG=R
shift
else
LANG=python
fi
cd ~/workspace/$LANG/notebooks
ARG=$1
if [ "$ARG" == "--pdf" ]
then
find . -type f -name "*.ipynb" -exec jupyter nbconvert --to pdf {} \;
mv **/*.pdf ./pdf/
mv ./*.pdf ./pdf/
else
find . -name "*.ipynb.json" -exec bash -c 'mv "$1" "${1%.ipynb.json}".ipynb' - '{}' \;
jupyter notebook
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment