1 ## ========================================
2 ## Commands for both workshop and lesson websites.
5 MAKEFILES=Makefile $(wildcard *.mk)
10 .PHONY : commands clean files
13 ## commands : show all commands.
15 @grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g'
17 ## serve : run a local server.
19 ${JEKYLL} serve --config _config.yml,_config_dev.yml
21 ## site : build files but do not run a server.
23 ${JEKYLL} build --config _config.yml,_config_dev.yml
25 ## figures : re-generate inclusion displaying all figures.
27 @bin/extract_figures.py -s _episodes -p bin/markdown-ast.rb > _includes/all_figures.html
29 ## clean : clean up junk files.
33 @rm -rf bin/__pycache__
34 @find . -name .DS_Store -exec rm {} \;
35 @find . -name '*~' -exec rm {} \;
36 @find . -name '*.pyc' -exec rm {} \;
38 ## ----------------------------------------
39 ## Commands specific to workshop websites.
41 .PHONY : workshop-check
43 ## workshop-check : check workshop homepage.
45 @bin/workshop_check.py .
47 ## ----------------------------------------
48 ## Commands specific to lesson websites.
50 .PHONY : lesson-check lesson-files lesson-fixme lesson-single
52 # Lesson source files in the order they appear in the navigation menu.
57 $(wildcard _episodes/*.md) \
59 $(wildcard _extras/*.md) \
62 # Generated lesson files in the order they appear in the navigation menu.
65 ${DST}/conduct/index.html \
66 ${DST}/setup/index.html \
67 $(patsubst _episodes/%.md,${DST}/%/index.html,$(wildcard _episodes/*.md)) \
68 ${DST}/reference/index.html \
69 $(patsubst _extras/%.md,${DST}/%/index.html,$(wildcard _extras/*.md)) \
70 ${DST}/license/index.html
72 ## lesson-check : validate lesson Markdown.
74 @bin/lesson_check.py -s . -p bin/markdown-ast.rb
77 python bin/test_lesson_check.py
79 ## lesson-files : show expected names of generated files for debugging.
81 @echo 'source:' ${SRC_FILES}
82 @echo 'generated:' ${HTML_FILES}
84 ## lesson-fixme : show FIXME markers embedded in source files.
86 @fgrep -i -n FIXME ${SRC_FILES} || true
88 #-------------------------------------------------------------------------------
89 # Include extra commands if available.
90 #-------------------------------------------------------------------------------