lift.Rd 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/lift.R
  3. \name{lift}
  4. \alias{lift}
  5. \title{Dockerize R Markdown Documents}
  6. \usage{
  7. lift(input = NULL, output_dir = NULL, dockerfile = NULL, ...)
  8. }
  9. \arguments{
  10. \item{input}{Input (R Markdown or Shiny R markdown) file or shiny app folder.}
  11. \item{output_dir}{Directory to output \code{Dockerfile}.
  12. If not provided, will be the same directory as \code{input}.}
  13. \item{dockerfile}{a Dockerfile path, if not, use our template.}
  14. \item{...}{Extra arguments passed to liftShinyApp function.}
  15. }
  16. \value{
  17. \code{Dockerfile} (and \code{Rabixfile} if possible).
  18. }
  19. \description{
  20. Generate \code{Dockerfile} for R Markdown documents.
  21. Rabix is supported if there is certain metadata in the R Markdown
  22. document: the function will generate a \code{Rabixfile} containing
  23. the parsed running parameters under the output directory.
  24. }
  25. \details{
  26. After running \link{lift}, run \link{drender} on the document to
  27. render the Dockerized R Markdown document using Docker containers.
  28. See \code{vignette('liftr-intro')} for details about the extended
  29. YAML front-matter metadata format used by liftr.
  30. }
  31. \examples{
  32. # 1. Dockerized R Markdown document
  33. dir_docker = paste0(tempdir(), '/lift_docker/')
  34. dir.create(dir_docker)
  35. file.copy(system.file("examples/docker.Rmd", package = "liftr"), dir_docker)
  36. # use lift() to parse Rmd and generate Dockerfile
  37. lift(paste0(dir_docker, "docker.Rmd"))
  38. # view generated Dockerfile
  39. readLines(paste0(dir_docker, "Dockerfile"))
  40. # 2. Dockerized R Markdown document with Rabix options
  41. dir_rabix = paste0(tempdir(), '/lift_rabix/')
  42. dir.create(dir_rabix)
  43. file.copy(system.file("template/rabix.Rmd", package = "liftr"), dir_rabix)
  44. lift(input = paste0(dir_rabix, "rabix.Rmd"))
  45. # view generated Dockerfile
  46. readLines(paste0(dir_rabix, "Dockerfile"))
  47. # view generated Rabixfile
  48. readLines(paste0(dir_rabix, "Rabixfile"))
  49. }