1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 #Run script with $Rscript createDoc.R input.Rmd output.html
7 require(knitr) # required for knitting from rmd to md
8 require(markdown) # required for md to html
10 args <- commandArgs(TRUE)
13 stop("Please provide 2 arguments corresponding to input and output file!")
15 inputFile <- args[[1]] # .Rmd file
16 outputFile <- args[[2]] # .html file
18 # Create and fill temp .md file from existing .Rmd file
19 #tempMdFile <- tempfile("tempREADME", fileext = "md")
20 knitr::knit(inputFile, outputFile)
21 #knitr::knit(inputFile, tempMdFile)
23 # Generate HTML from temporary .md file
24 #markdown::markdownToHTML(tempMdFile, outputFile)