1 ## ========================================
2 ## Commands for both workshop and lesson websites.
5 MAKEFILES=Makefile $(wildcard *.mk)
7 PARSER=bin/markdown_ast.rb
11 .PHONY : commands clean files
14 ## commands : show all commands.
16 @grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
18 ## serve : run a local server.
20 ${JEKYLL} serve --config _config.yml,_config_dev.yml
22 ## site : build files but do not run a server.
24 ${JEKYLL} build --config _config.yml,_config_dev.yml
26 ## figures : re-generate inclusion displaying all figures.
28 @bin/extract_figures.py -s _episodes -p ${PARSER} > _includes/all_figures.html
30 ## clean : clean up junk files.
34 @rm -rf bin/__pycache__
35 @find . -name .DS_Store -exec rm {} \;
36 @find . -name '*~' -exec rm {} \;
37 @find . -name '*.pyc' -exec rm {} \;
39 ## ----------------------------------------
40 ## Commands specific to workshop websites.
42 .PHONY : workshop-check
44 ## workshop-check : check workshop homepage.
46 @bin/workshop_check.py .
48 ## ----------------------------------------
49 ## Commands specific to lesson websites.
51 .PHONY : lesson-check lesson-files lesson-fixme lesson-single
53 # Lesson source files in the order they appear in the navigation menu.
58 $(wildcard _episodes/*.md) \
60 $(wildcard _extras/*.md) \
63 # Generated lesson files in the order they appear in the navigation menu.
66 ${DST}/conduct/index.html \
67 ${DST}/setup/index.html \
68 $(patsubst _episodes/%.md,${DST}/%/index.html,$(wildcard _episodes/*.md)) \
69 ${DST}/reference/index.html \
70 $(patsubst _extras/%.md,${DST}/%/index.html,$(wildcard _extras/*.md)) \
71 ${DST}/license/index.html
73 ## lesson-check : validate lesson Markdown.
75 @bin/lesson_check.py -s . -p ${PARSER}
78 python bin/test_lesson_check.py
80 ## lesson-files : show expected names of generated files for debugging.
82 @echo 'source:' ${SRC_FILES}
83 @echo 'generated:' ${HTML_FILES}
85 ## lesson-fixme : show FIXME markers embedded in source files.
87 @fgrep -i -n FIXME ${SRC_FILES} || true
89 #-------------------------------------------------------------------------------
90 # Include extra commands if available.
91 #-------------------------------------------------------------------------------