Created
November 13, 2015 05:42
-
-
Save anandology/6c27e81fcf12f7891aa9 to your computer and use it in GitHub Desktop.
Makefile to export jupyterhub notebooks for all users to html
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
# | |
# Makefile to export ipython notebooks in each user home to html | |
# The output goes to build/$USER/$FILENAME.html | |
# | |
SOURCES=$(wildcard /home/*/*.ipynb) | |
TARGETS=$(shell echo $(SOURCES) | sed -e 's/.ipynb/.html/g' -e 's,/home/,build/,g') | |
default: $(TARGETS) | |
debug: | |
@echo SOURCES: $(SOURCES) | |
@echo TARGETS: $(TARGETS) | |
build/%.html: /home/%.ipynb | |
@mkdir -p `dirname $@` | |
jupyter nbconvert --to html --stdout $< > $@ | |
clean: | |
-rm $(TARGETS) | |
loop: | |
@while echo; do make; sleep 2; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment