aboutsummaryrefslogtreecommitdiff
path: root/slides/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'slides/Makefile')
-rw-r--r--slides/Makefile39
1 files changed, 20 insertions, 19 deletions
diff --git a/slides/Makefile b/slides/Makefile
index 727031c..4f2b761 100644
--- a/slides/Makefile
+++ b/slides/Makefile
@@ -1,9 +1,12 @@
-P=what-is-iot
+P=connected-arduino
# Madrid Pittsburgh boxes
SLIDE_THEME?=boxes
PDFS=$(P)-text.pdf $(P)-slides.pdf
HTMLS=$(P)-reveal.html
+BUILD_DIR=build
+TEMPLATE_DIR=templates
+TEMPLATE_BEAMER=$(TEMPLATE_DIR)/beamer.tex
ifeq (1,$(QUICK))
PP_DEFS+=QUICK
PDF_ENGINE = xelatex
@@ -17,11 +20,11 @@ endif
RUN_PP_BEAMER=pp -DBEAMER $(patsubst %,-D%,$(PP_DEFS))
RUN_PP_REVEALJS=pp -DREVEALJS $(patsubst %,-D%,$(PP_DEFS))
RUN_PANDOC_BEAMER=pandoc -f markdown -t beamer $(PANDOC_ARGS) -V theme:$(SLIDE_THEME) \
- --pdf-engine=$(PDF_ENGINE)
+ --pdf-engine=$(PDF_ENGINE) --template=$(TEMPLATE_BEAMER) -V toc-depth:4
RUN_PANDOC_REVEALJS=pandoc -f markdown -t revealjs -s -V revealjs-url=./bower_components/reveal.js
RUN_PANDOC_TEXT=pandoc -f markdown --pdf-engine=$(PDF_ENGINE)
-all: toc.md $(PDFS) $(HTMLS)
+all: toc.md $(PDFS)
slides: $(P)-slides.tex $(P)-slides.pdf
html: $(P)-reveal.html
@@ -42,28 +45,28 @@ spell: .$(P).md.spell
$(P).md: Makefile
@touch $@
-include $(P).beamer.md.d
-include $(P).revealjs.md.d
+$(BUILD_DIR):
+ mkdir -p $(BUILD_DIR)
-%.beamer.md: %.md .var/QUICK
+%.beamer.md: %.md
$(RUN_PP_BEAMER) < $< > $@
-%.beamer.md.d: %.md
+$(BUILD_DIR)/%.beamer.md.d: %.md | $(BUILD_DIR)
$(RUN_PP_BEAMER) -M $< < $< > $@
%-text.pdf: %.beamer.md
$(RUN_PANDOC_TEXT) -o $@ $<
-%-slides.pdf: %.beamer.md .var/SLIDE_THEME
+%-slides.pdf: %.beamer.md $(TEMPLATE_BEAMER)
$(RUN_PANDOC_BEAMER) -o $@ $<
-%-slides.tex: %.beamer.md .var/SLIDE_THEME
+%-slides.tex: %.beamer.md $(TEMPLATE_BEAMER)
$(RUN_PANDOC_BEAMER) -o $@ $<
-%.revealjs.md: %.md# %.revealjs.md.d
+%.revealjs.md: %.md# $(BUILD_DIR)/%.revealjs.md.d
$(RUN_PP_REVEALJS) < $< > $@
-%.revealjs.md.d: %.md
+$(BUILD_DIR)/%.revealjs.md.d: %.md | $(BUILD_DIR)
$(RUN_PP_REVEALJS) -M $< < $< > $@
%-reveal.html: %.revealjs.md
@@ -74,13 +77,11 @@ images/%.pdf: images/%.tex | images/pp-template Makefile
xelatex -output-directory=images $(patsubst %.tex,%-full.tex,$<)
mv $(patsubst %.pdf,%-full.pdf,$@) $@
+$(TEMPLATE_BEAMER): $(dir $(TEMPLATE_BEAMER))
+ pandoc --print-default-template=beamer > $@
-VARS=SLIDE_THEME QUICK
+$(dir $(TEMPLATE_BEAMER)):
+ mkdir -p $@
-define refresh =
-.var/$(1)::
- @mkdir -p .var
- @./refresh $$@ $(1) $($(1))
-endef
-
-$(foreach var,$(VARS),$(eval $(call refresh,$(var))))
+-include $(BUILD_DIR)/$(P).beamer.md.d
+-include $(BUILD_DIR)/$(P).revealjs.md.d