Skip to content
Snippets Groups Projects
Select Git revision
  • 2019
  • 2023 default
  • pages protected
  • 2022-matse
  • 2022
  • 2021
  • master
7 results

Makefile

Blame
  • Makefile 1.46 KiB
    SLIDES = Introduction-to-Pandas--slides.html
    SUBNOTEBOOKS = Introduction-to-Pandas--slides.ipynb Introduction-to-Pandas--tasks.ipynb Introduction-to-Pandas--solution.ipynb
    
    MASTER_NOTEBOOK = Introduction-to-Pandas--master.ipynb
    
    DEP_PRESENTATION = reveal_options.txt fzj.js custom.css Makefile
    
    .PHONY: all presentation subnotebooks presentation-pdf
    all: presentation subnotebooks
    presentation: $(SLIDES)
    presentation-pdf: $(SLIDES:html=pdf)
    subnotebooks: $(SUBNOTEBOOKS)
    
    %.html: %.ipynb $(DEP_PRESENTATION)
    	jupyter nbconvert --to=slides --reveal-prefix=reveal.js --stdout $< \
    	| awk '/reveal.js"/ { print "     " $$1 ","; print "     \"fzj.js\""; next }1' \
    	| sed '/transition/r reveal_options.txt' \
    	> $@
    
    %.pdf: %.html $(DEP_PRESENTATION)
    	# This needs to have artificially large paper size in order to fix bug https://github.com/astefanutti/decktape/issues/151#issuecomment-456166075
    	decktape --size "2560x1440" reveal $< $@
    
    Introduction-to-Pandas--slides.ipynb: $(MASTER_NOTEBOOK)
    	./notebook-task-filter.py $< --keep task --keep solution --keep onlypresentation --remove onlytask --remove onlysolution --remove nopresentation -o $@
    
    Introduction-to-Pandas--tasks.ipynb: $(MASTER_NOTEBOOK)
    	./notebook-task-filter.py $< --keep task --keep nopresentation --keep onlytask --remove solution --remove all -o $@
    
    Introduction-to-Pandas--solution.ipynb: $(MASTER_NOTEBOOK)
    	./notebook-task-filter.py $< --keep task --keep nopresentation --keep solution --keep onlysolution --remove all -o $@