-
Notifications
You must be signed in to change notification settings - Fork 86
/
make-ipynb.mk
executable file
·38 lines (32 loc) · 1.55 KB
/
make-ipynb.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
%.notes.ipynb.markdown: %.md ${DEPS}
${PP} $< -o $@ --format notes --snippets-path ${SNIPPETSDIR} --write-diagrams-dir ${WRITEDIAGRAMSDIR} --to ipynb --code ipynb --replace-notation --edit-links --exercises ${PPFLAGS}
%.full.ipynb.markdown: %.md ${DEPS}
${PP} $< -o $@ --format notes --to ipynb --code full --snippets-path ${SNIPPETSDIR} --edit-links --replace-notation ${PPFLAGS}
%.slides.ipynb.markdown: %.md ${DEPS}
${PP} $< -o $@ --format slides --to ipynb --snippets-path ${SNIPPETSDIR} ${PPFLAGS}
${BASE}.ipynb: ${BASE}.notes.ipynb.markdown
pandoc --template pandoc-jekyll-ipynb-template \
--markdown-headings=atx \
--out ${BASE}.tmp.markdown ${BASE}.notes.ipynb.markdown
pandoc ${PDSFLAGS} \
--out $@ ${BASE}.tmp.markdown
#notedown ${BASE}.tmp.markdown > ${BASE}.ipynb
cp ${BASE}.ipynb ${NOTEBOOKSDIR}/${OUT}.ipynb
rm ${BASE}.tmp.markdown
${BASE}.full.ipynb: ${BASE}.full.ipynb.markdown
pandoc --template pandoc-jekyll-ipynb-template \
--markdown-headings=atx \
--out ${BASE}.tmp.markdown ${BASE}.full.ipynb.markdown
pandoc ${PDSFLAGS} \
--out $@ ${BASE}.tmp.markdown
#notedown ${BASE}.tmp.markdown > ${BASE}.ipynb
cp ${BASE}.full.ipynb ${NOTEBOOKSDIR}/${OUT}.full.ipynb
rm ${BASE}.tmp.markdown
${BASE}.slides.ipynb: ${BASE}.slides.ipynb.markdown
pandoc --template pandoc-jekyll-ipynb-template \
--markdown-headings=atx \
${CITEFLAGS} \
--out ${BASE}.tmp.markdown ${BASE}.slides.ipynb.markdown
notedown ${BASE}.tmp.markdown > ${BASE}.slides.ipynb
cp ${BASE}.slides.ipynb ${NOTEBOOKSDIR}/${OUT}.slides.ipynb
rm ${BASE}.tmp.markdown