Skip to content

Instantly share code, notes, and snippets.

@anandology
Created November 13, 2015 05:42
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anandology/6c27e81fcf12f7891aa9 to your computer and use it in GitHub Desktop.
Makefile to export jupyterhub notebooks for all users to html
#
# 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