Skip to content

Commit

Permalink
Merge branch '2016-06' of github.com:swcarpentry/styles into 2016-06
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Wilson committed Jun 27, 2016
2 parents 079d7d5 + 4c788a5 commit 40dbc70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions bin/chunk-options.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 40dbc70

Please sign in to comment.