Learn R Programming

workflowr (version 0.2.0)

make_site: Render only the updated R Markdown files

Description

make_site provides Makefile-like functionality to render only the R Markdown files that have been modified. This is in contrast to rmarkdown::render_site, which always renders all the pages. You should use the latter if you've made aesthetic changes that you want applied to all the R Markdown files.

Usage

make_site(dry_run = FALSE, path = ".", ...)

Arguments

dry_run

Identifies R Markdown files that have been updated, but does not render them.

path

By default the function assumes the current working directory is within the project. If this is not true, you'll need to provide the path to the project directory.

...

Additional arguments that can be passed to rmarkdown::render_site. Should only be needed for testing potential changes. Any permanent settings should be specified in analysis/_site.yml.

Value

If dry_run = TRUE, returns the character vector of R Markdown files that would be rendered. Otherwise invisibly returns this vector.

Details

Under the hood, this runs rmarkdown::render_site on each updated file individually. This provides all the website styling (which you would lose if you ran rmarkdown::render) without re-building the entire site (which would happen if you ran rmarkdown::render_site with no arguments).

Examples

Run this code
# NOT RUN {
make_site()
# }

Run the code above in your browser using DataLab