-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
100 lines (77 loc) · 2.63 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Makefile for rendering the website
SHELL := pwsh.exe
# Define the output directory
FREEZE_DIR := _freeze
# Define the render command
QUARTO_CMD := quarto
RENDER_CMD := $(QUARTO_CMD) render
PREVIEW_CMD := $(QUARTO_CMD) preview
PUBLISH_CMD := $(QUARTO_CMD) publish gh-pages
PWSH_CMD := pwsh.exe -Command
MAX_NB_SLIDES := 104
# Define the target for rendering all the website
all: render print
README.md: _README.qmd
$(RENDER_CMD) _README.qmd
# Render the pre tutorial website
render: index.html index-for-print.html
index.html: index.qmd
$(RENDER_CMD) $<
index-for-print.html: index.qmd
$(RENDER_CMD) $< -M print:true --output $@
preview:
$(PREVIEW_CMD)
publish:
$(PUBLISH_CMD)
# Define the clean target
clean: clean-output clean-freeze clean-print
clean-output:
ifeq ($(OS),Windows_NT)
$(PWSH_CMD) "Remove-Item -Force index*.html"
$(PWSH_CMD) "if (Test-Path index_files) {Remove-Item -Recurse -Force index_files}"
$(PWSH_CMD) "if (Test-Path index_cache) {Remove-Item -Recurse -Force index_cache}"
else
rm index*.html
rm -rf index_files
rm -rf index_cache
endif
clean-freeze:
ifeq ($(OS),Windows_NT)
$(PWSH_CMD) "if (Test-Path $(FREEZE_DIR)) { Remove-Item -Recurse -Force $(FREEZE_DIR) }"
else
[ -d $(FREEZE_DIR) ] && rm -rf $(FREEZE_DIR) || true
endif
clean-print:
ifeq ($(OS),Windows_NT)
$(PWSH_CMD) "Remove-Item -Force slides-*.pdf"
else
rm -f slides-*.pdf
endif
print: slides-full.pdf
slides-full.pdf: index-for-print.html
ifeq ($(OS),Windows_NT)
$(PWSH_CMD) "docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 generic --max-slides=$(MAX_NB_SLIDES) /slides/$< $@"
else
docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 generic --max-slides=$(MAX_NB_SLIDES) /slides/$< $@
endif
print-simple: slides-simple.pdf
slides-simple.pdf: index.html
ifeq ($(OS),Windows_NT)
$(PWSH_CMD) "docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 reveal /slides/$< $@"
else
docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 reveal /slides/$< $@
endif
print-auto: slides-auto.pdf
slides-auto.pdf: index.html
ifeq ($(OS),Windows_NT)
$(PWSH_CMD) "docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 /slides/$< $@"
else
docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 reveal /slides/$< $@
endif
print-screenshot: slides-screenshot.pdf
slides-screenshot.pdf: index-for-print.html
ifeq ($(OS),Windows_NT)
$(PWSH_CMD) "docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 --screenshots-size=1280x720 reveal /slides/$< $@"
else
docker run --rm -t -v .:/slides astefanutti/decktape -s 1280x720 --screenshots-size=1280x720 reveal /slides/$< $@
endif