Commit 926c4d89 authored by Francois Michonneau's avatar Francois Michonneau
Browse files

check knitr version before converting Rmd to md

on a suggestion of @sritchie73 and @aammd
parent 3dbfc022
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -62,7 +62,8 @@ motivation.html : motivation.md _layouts/slides.revealjs Makefile
	    -o $@ $<

# Pattern to convert R Markdown to Markdown.
%.md: %.Rmd $(R_CHUNK_OPTS)
%.md: %.Rmd $(R_CHUNK_OPTS) tools/check_knitr_version.R
	Rscript -e "source('tools/check_knitr_version.R')"
	Rscript -e "knitr::knit('$$(basename $<)', output = '$$(basename $@)')"

## commands : Display available commands.
+5 −0
Original line number Diff line number Diff line
if (require("knitr")) {
    if (packageVersion("knitr") < '1.9.19') {
        stop("knitr must be version 1.9.20 or higher")
    }
} else stop("knitr 1.9.20 or above is needed to build the lessons.")