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
Embed
What would you like to do?
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