wflow_publish: Publish the site

Description Usage Arguments Value See Also Examples

Description

wflow_publish is the main workflowr function. Use it when you are ready to publish an analysis to your site. wflow_publish performs three steps: 1) commit the file(s), 2) rebuild the R Markdown file(s), 3) commit the generated website file(s). These steps ensure that the version of the HTML file is created by the latest version of the R Markdown file, which is critical for reproducibility.

Usage

1
2
3
wflow_publish(files = NULL, message = NULL, all = FALSE, force = FALSE,
  update = FALSE, republish = FALSE, view = interactive(), seed = 12345,
  dry_run = FALSE, project = ".")

Arguments

files

character (default: NULL). Files to be added and committed with Git (step 1). Any R Markdown files will also be built (step 2) and their output HTML and figures will be subsequently committed (step 3). Supports file globbing.

message

character (default: NULL). A commit message.

all

logical (default: FALSE). Automatically stage files that have been modified and deleted. Equivalent to: git commit -a

force

logical (default: FALSE). Allow adding otherwise ignored files. Equivalent to: git add -f

update

logical (default: FALSE). Build any files that have been committed more recently than their corresponding HTML files (and do not have any unstaged or staged changes). This ensures that the commit version ID inserted into the HTML corresponds to the exact version of the source file that was used to produce it.

republish

logical (default: FALSE). Build all published R Markdown files. Useful for site-wide changes like updating the theme, navigation bar, or any other setting in _site.yml.

view

logical (default: interactive). View the website with wflow_view after building files. If only one file is built, it is opened. If more than one file is built, the main index page is opened. Not applicable if no files are built or if dry_run = TRUE.

seed

numeric (default: 12345). The seed to set before building each file. Passed to set.seed.

dry_run

logical (default: FALSE). Preview the proposed action but do not actually add or commit any files.

project

character (default: ".") 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.

Value

Returns an object of class wflow_publish, which is a list with the following elements:

See Also

wflow_commit, wflow_build

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# single file
wflow_publish("analysis/file.Rmd", "Informative commit message")
# All tracked files that have been edited
wflow_publish(all = TRUE, message = "Informative commit message")
# A new file plus all tracked files that have been edited
wflow_publish("analysis/file.Rmd", "Informative commit message", all = TRUE)
# Multiple files
wflow_publish(c("analysis/file.Rmd", "analysis/another.Rmd"),
              "Informative commit message")
# All R Markdown files that start with the pattern "new_"
wflow_publish("analysis/new_*Rmd", "Informative commit message")
# Republish all published files regardless of whether they have been
# modified. Useful for changing some universal aspect of the site,
# e.g. the theme specifid in _site.yml.
wflow_publish("analysis/_site.yml", "Informative commit message",
              republish = TRUE)


## End(Not run)

jdblischak/workflowrBeta documentation built on May 17, 2019, 7:28 p.m.