-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
53 lines (44 loc) · 1.54 KB
/
Makefile
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.PHONY: all website
server:
docker run --rm -ti -p 8888:8888 -p 4000:4000 -v ${PWD}:/home/jovyan/work darribas/gds_dev:5.0
compile_website:
rm -rf tmp
cp -r site_scaffolding tmp
cp -r src/pages tmp/pages
cp -r src/blocks tmp/blocks
cp -r src/slidedecks tmp/slidedecks
cp -r src/labs tmp/labs
cp -r src/slides tmp/slides
website_local: compile_website
rm -rf _site
cd tmp && jekyll serve --watch --host 0.0.0.0 --incremental
rm -rf tmp/_site
website: compile_website
cd tmp \
&& rm -rf _site \
&& jekyll build
rm -rf docs/
mv tmp/_site docs
touch docs/.nojekyll
rm -rf tmp/
website_reset:
rm -rf ./docs/
git checkout HEAD ./docs/
# Run for example as: `make slide no=01`
slide:
pandoc -t html5 --template=src/slidedecks/template.revealjs --standalone --section-divs --variable theme="journal" --variable transition="linear" src/slides/lecture_$(no).md -o src/slidedecks/lecture_$(no).html
decktape automatic --chrome-arg=--no-sandbox -s 1280x960 src/slidedecks/lecture_$(no).html src/slidedecks/lecture_$(no).pdf
lab_md:
cd src/labs && \
jupyter nbconvert --to markdown lab_$(no).ipynb && \
jupyter nbconvert --to markdown --stdout lab_$(no).ipynb | \
sed '1s;^;---\nlayout: notebook\nblock: b$(no)\n---\n\n[**NOTE**: you can download an `.ipynb` version of this file [here]({{site.baseurl}}/labs/lab_$(no).ipynb)]\n;' > \
lab_$(no).md
lab_pdf:
cd src/labs && \
pandoc -V documentclass=tufte-handout \
--template=tufte-handout.tex \
--pdf-engine=xelatex \
--highlight-style=kate \
-s lab_$(no).md \
-o lab_$(no).pdf