Commit e3309547 authored by Holger Brandl's avatar Holger Brandl

- added placeholder subistution for _TODAY_

- more yaml tweaks
parent 65187728
...@@ -48,10 +48,10 @@ tmpScript <- tempfile(fileext=".R") ...@@ -48,10 +48,10 @@ tmpScript <- tempfile(fileext=".R")
## remove sheband and comment-only lines from source document ## remove sheband and comment-only lines from source document
#file.copy(r_script, tmpScript) #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 ## add yaml header (will be ignored if already present
metadata <- paste0('#\n', metadata <- paste0('#\'\n\n',
'#\' ---\n', '#\' ---\n',
'#\' title: ""\n', '#\' title: ""\n',
'#\' author: ""\n', '#\' author: ""\n',
......
...@@ -14,3 +14,5 @@ rmarkdown::render(input="/Users/brandl/Dropbox/projects/snippets/R/rmarkdown/tes ...@@ -14,3 +14,5 @@ rmarkdown::render(input="/Users/brandl/Dropbox/projects/snippets/R/rmarkdown/tes
#' # Pandoc #' # Pandoc
#' All options are listed at http://pandoc.org/README.html and can be used as "pandoc_args" in html_document #' 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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment