Permalink
Browse files

run slidify with KnitHTML only if YAML front matter is found.

  • Loading branch information...
1 parent 7264e2e commit a37c7e5381acff43792fb2f1cf6b00563b644582 @ramnathv committed Nov 9, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 R/zzz.R
View
@@ -1,6 +1,11 @@
.onLoad <- function(libname, pkgname){
- options(rstudio.markdownToHTML =
+ options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
- slidify(inputFile, outputFile, knit_deck = FALSE)
+ if (readLines(inputFile)[1] == '---'){
+ slidify(inputFile, outputFile, knit_deck = FALSE)
+ } else {
+ require(markdown)
+ markdownToHTML(inputFile, outputFile)
+ }
})
}

0 comments on commit a37c7e5

Please sign in to comment.