Only (re)make changed notebooks.
I love make. (Despite not working with spaces in filenames, since that's a dumbass thing to do anyway.) There's probably a better way to do what I did but it works so I'm happy.
This commit is contained in:
parent
d050180b88
commit
989e48c155
|
|
@ -1,18 +1,24 @@
|
||||||
#docs := $(wildcard *.ipynb)
|
docs = $(wildcard *.ipynb)
|
||||||
#docs_html := $(patsubst %.ipynb,%.html,$(docs))
|
docs_html = $(patsubst %.ipynb,%.html,$(docs))
|
||||||
|
docs_md = $(patsubst %.ipynb,%.md,$(docs))
|
||||||
|
docs_rst = $(patsubst %.ipynb,%.rst,$(docs))
|
||||||
|
|
||||||
.PHONY: poop
|
.PHONY: clean sdist test docs
|
||||||
|
|
||||||
|
|
||||||
poop: *.ipynb
|
all: $(docs_html) $(docs_md) $(docs_rst)
|
||||||
make "$(patsubst %.ipynb,%.html,$<)"
|
|
||||||
|
|
||||||
%.html : %.ipynb
|
|
||||||
|
clean:
|
||||||
|
$(RM) -v $(docs_html) $(docs_md) $(docs_rst)
|
||||||
|
|
||||||
|
|
||||||
|
$(docs_html): %.html : %.ipynb
|
||||||
python -m nbconvert --to html $<
|
python -m nbconvert --to html $<
|
||||||
|
|
||||||
%.md : %.ipynb
|
$(docs_md): %.md : %.ipynb
|
||||||
python -m nbconvert --to markdown $<
|
python -m nbconvert --to markdown $<
|
||||||
|
|
||||||
%.rst : %.ipynb
|
$(docs_rst): %.rst : %.ipynb
|
||||||
python -m nbconvert --to rst $<
|
python -m nbconvert --to rst $<
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue