X-Git-Url: https://git.arvados.org/rnaseq-cwl-training.git/blobdiff_plain/9c447b8e6ca87637b4ada4a6361c56d06cd8f0f8..0c9c1533a0956617f7c14b8adced2057d70169bc:/Makefile diff --git a/Makefile b/Makefile index b645947..ddc68bd 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ # Settings MAKEFILES=Makefile $(wildcard *.mk) JEKYLL=jekyll +PARSER=bin/markdown_ast.rb DST=_site # Controls @@ -15,16 +16,16 @@ commands : @grep -h -E '^##' ${MAKEFILES} | sed -e 's/## //g' ## serve : run a local server. -serve : +serve : lesson-rmd ${JEKYLL} serve --config _config.yml,_config_dev.yml ## site : build files but do not run a server. -site : +site : lesson-rmd ${JEKYLL} build --config _config.yml,_config_dev.yml ## figures : re-generate inclusion displaying all figures. figures : - @bin/extract_figures.py -s _episodes -p bin/markdown-ast.rb > _includes/all_figures.html + @bin/extract_figures.py -s _episodes -p ${PARSER} > _includes/all_figures.html ## clean : clean up junk files. clean : @@ -34,6 +35,8 @@ clean : @find . -name .DS_Store -exec rm {} \; @find . -name '*~' -exec rm {} \; @find . -name '*.pyc' -exec rm {} \; + @rm -rf ${RMD_DST} + @rm -rf fig/swc-rmd-* ## ---------------------------------------- ## Commands specific to workshop websites. @@ -47,7 +50,11 @@ workshop-check : ## ---------------------------------------- ## Commands specific to lesson websites. -.PHONY : lesson-check lesson-files lesson-fixme lesson-single +.PHONY : lesson-check lesson-rmd lesson-files lesson-fixme + +# RMarkdown files +RMD_SRC = $(wildcard _episodes_rmd/??-*.Rmd) +RMD_DST = $(patsubst _episodes_rmd/%.Rmd,_episodes/%.md,$(RMD_SRC)) # Lesson source files in the order they appear in the navigation menu. SRC_FILES = \ @@ -69,15 +76,20 @@ HTML_FILES = \ $(patsubst _extras/%.md,${DST}/%/index.html,$(wildcard _extras/*.md)) \ ${DST}/license/index.html +## lesson-rmd: : convert Rmarkdown files to markdown +lesson-rmd: $(RMD_SRC) + @bin/knit_lessons.sh + ## lesson-check : validate lesson Markdown. lesson-check : - @bin/lesson_check.py -s . -p bin/markdown-ast.rb + @bin/lesson_check.py -s . -p ${PARSER} unittest : python bin/test_lesson_check.py ## lesson-files : show expected names of generated files for debugging. lesson-files : + @echo 'RMarkdown:' ${RMD_SRC} @echo 'source:' ${SRC_FILES} @echo 'generated:' ${HTML_FILES}