jekyll(dir = ".", input = c(".", "_source", "_posts"), output = c(".",
"_posts", "_posts"), script = c("Makefile", "build.R"), serve = TRUE,
command = "jekyll build", ...)rmdv2(dir = ".", script = c("Makefile", "build.R"), in_session = FALSE,
...)
rmdv1(dir = ".", script = c("Makefile", "build.R"), in_session = FALSE,
...)
output
directories)input
; for an
input document input[i]
, its
output document output[i]
make
), or (if Makefile not found)
the name of an R script to re-build R Markdown documents, which will be
executed via command line of the form FALSE
, the R Markdown
documents and the website will be compiled but not servedserver_config()
TRUE
) or in a separate new R session (FALSE
); if the
former, the argument script
can be a function with two arguments,
the filenames of the source jekyll()
sets up a web server to serve a Jekyll-based
website. A connection is established between R and the HTML pages through
WebSockets so that R can notify the HTML pages to refresh themselves if any R
Markdown documents have been re-compiled.The functions rmdv1()
and rmdv2()
are similar to
jekyll()
, and the only difference is the way to compile R Markdown
documents: rmdv1()
uses the knit2html()
, and rmdv2()
calls
render()
in the
servr::jekyll()
.if (interactive()) servr::rmdv1() # serve the current dir with R Markdown v1
if (interactive()) servr::rmdv2() # or R Markdown v2
# built-in examples
servr::serve_example("rmd", servr::rmdv1)
servr::serve_example("rmd", servr::rmdv2)
Run the code above in your browser using DataLab