From: Greg Wilson Date: Sat, 25 Jun 2016 14:24:34 +0000 (-0400) Subject: Only cleaning intermediate R files on demand. X-Git-Url: https://git.arvados.org/rnaseq-cwl-training.git/commitdiff_plain/5217736aeb4b2e9f76a8cecf4d127a094a901281 Only cleaning intermediate R files on demand. 1. Splitting commands to clean intermediate R files into separate target. These files must be committed to the repo, so they shouldn't be deleted under normal circumstances. 2. Modifying intermediate file generation to create fig/rmd-* rather than fig/swc-rmd-*, since this template is used by other carpentries (not just SWC). --- diff --git a/Makefile b/Makefile index c8011dd..7b1b1b9 100644 --- a/Makefile +++ b/Makefile @@ -35,8 +35,11 @@ clean : @find . -name .DS_Store -exec rm {} \; @find . -name '*~' -exec rm {} \; @find . -name '*.pyc' -exec rm {} \; + +## clean-rmd : clean intermediate R files (that need to be committed to the repo). +clear-rmd : @rm -rf ${RMD_DST} - @rm -rf fig/swc-rmd-* + @rm -rf fig/rmd-* ## ---------------------------------------- ## Commands specific to workshop websites. diff --git a/bin/chunk-options.R b/bin/chunk-options.R index 1890d32..5836973 100644 --- a/bin/chunk-options.R +++ b/bin/chunk-options.R @@ -8,18 +8,20 @@ library("knitr") fix_fig_path <- function(pth) file.path("..", pth) -## We use the swc-rmd- prefix for the figures generated by the lssons -## so they can be easily identified and deleted by `make clean`. The +## We use the rmd- prefix for the figures generated by the lssons so +## they can be easily identified and deleted by `make clean-rmd`. The ## working directory when the lessons are generated is the root so the ## figures need to be saved in fig/, but when the site is generated, ## the episodes will be one level down. We fix the path using the ## `fig.process` option. + opts_chunk$set(tidy = FALSE, results = "markup", comment = NA, - fig.align = "center", fig.path = "fig/swc-rmd-", + fig.align = "center", fig.path = "fig/rmd-", fig.process = fix_fig_path) # The hooks below add html tags to the code chunks and their output so that they # are properly formatted when the site is built. + hook_in <- function(x, options) { stringr::str_c("\n\n~~~\n", paste0(x, collapse="\n"),