Newer
Older
# Directories.
SRC_DIR = .
DST_DIR = ..
# Files.
SRC_PAGES = $(wildcard *.md)
DST_PAGES = $(patsubst %.md,$(DST_DIR)/%.html,$(SRC_PAGES))
# Inclusions.
INCLUDES = \
-Vheader="$$(cat ../_includes/header.html)" \
-Vbanner="$$(cat ../_includes/banner.html)" \
-Vfooter="$$(cat ../_includes/footer.html)" \
-Vjavascript="$$(cat ../_includes/javascript.html)"
Greg Wilson
committed
# Default action is to show what commands are available.
all : commands
## preview : Build website locally for checking.
preview : $(DST_PAGES)
Greg Wilson
committed
# Pattern for slides (different parameters and template).
$(DST_DIR)/motivation.html : $(SRC_DIR)/motivation.md ../_layouts/slides.html
pandoc -s -t html \
--template=../_layouts/slides \
-o $@ $<
# Pattern to build a generic page.
Greg Wilson
committed
$(DST_DIR)/%.html : $(SRC_DIR)/%.md ../_layouts/page.html
pandoc -s -t html \
--template=../_layouts/page \
--filter=../tools/blockquote2div.py \
## commands : Display available commands.
commands : Makefile
@sed -n 's/^## //p' $<
## update : Update the shared files from the GitHub repo holding them.
# FIXME: need to create that repo.
update :
git pull --rebase=false https://github.com/swcarpentry/lesson-template-shared.git master
## settings : Show variables and settings.
settings :
@echo 'SRC_DIR:' $(SRC_DIR)
@echo 'DST_DIR:' $(DST_DIR)
@echo 'SRC_PAGES:' $(SRC_PAGES)
@echo 'DST_PAGES:' $(DST_PAGES)
## clean : Clean up temporary and intermediate files.
clean :
@rm -rf $$(find .. -name '*~' -print)
Greg Wilson
committed
# very-clean : Remove generated HTML.
very-clean :
Greg Wilson
committed
@rm -f $(DST_PAGES)