diff_rmd: Render the differences between two rmarkdown files

View source: R/rmd_diffs.R

diff_rmdR Documentation

Render the differences between two rmarkdown files

Description

Render the differences between two rmarkdown files

Usage

diff_rmd(current_file, reference_file = "HEAD", show = "raw",
  output_format = "html_document", keep_intermediate = FALSE,
  quiet = TRUE, css = diff_rmd_css())

diff_rmd_css()

Arguments

current_file

string: path to file after changes

reference_file

string: path to file before changes

show

string: "raw" (show differences in the raw rmarkdown file) or "rendered" (show differences in the rendered output). Note that the "rendered" output is unlikely to work well if a change has been made inside a code block in the rmarkdown document. The primary use for this package is anticipated to be the "raw" output

output_format

string: format of the output file (currently only "html_document")

keep_intermediate

logical: keep the intermediate rmarkdown file?

quiet

logical: if TRUE, suppress pandoc output (Only applicable if show="rendered")

css

character vector: css specification to apply to changed sections. Defaults to diff_rmd_css(); specify NULL to not include a <style> section in the output

Value

A list containing one or more elements rendered (the path to the rendered diff file, if show="rendered"), intermediate (the path to the intermediate file, if keep_intermediate = TRUE), and raw (if show="raw")

The path to the rendered file showing the differences

Examples

## Not run: 
  result <- diff_rmd(my_current_file, my_reference_file)
  browseURL(result)

## End(Not run)


ropenscilabs/reviewer documentation built on May 17, 2022, 2:07 p.m.