Skip to content
Snippets Groups Projects
Commit e3309547 authored by Holger Brandl's avatar Holger Brandl
Browse files

- added placeholder subistution for _TODAY_

- more yaml tweaks
parent 65187728
No related branches found
No related tags found
No related merge requests found
......@@ -48,10 +48,10 @@ tmpScript <- tempfile(fileext=".R")
## remove sheband and comment-only lines from source document
#file.copy(r_script, tmpScript)
system(paste("cat ", r_script," | grep -Ev '^#+$' | grep -Fv '#!/usr/bin/env Rscript' >", tmpScript))
system(paste("cat ", r_script," | sed 's/_TODAY_/'$(date +\"%m-%d-%Y\")'/g' | grep -Ev '^#+$' | grep -Fv '#!/usr/bin/env Rscript' >", tmpScript))
## add yaml header (will be ignored if already present
metadata <- paste0('#\n',
metadata <- paste0('#\'\n\n',
'#\' ---\n',
'#\' title: ""\n',
'#\' author: ""\n',
......
......@@ -14,3 +14,5 @@ rmarkdown::render(input="/Users/brandl/Dropbox/projects/snippets/R/rmarkdown/tes
#' # Pandoc
#' All options are listed at http://pandoc.org/README.html and can be used as "pandoc_args" in html_document
#' yaml header is parsed in https://github.com/rstudio/rmarkdown/blob/a46a78fa241e86170a6bb3db02cfb9342ccc86a2/R/render.R
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment