Learn R Programming

parsermd (version 0.1.3)

rmd_check_template: Check an Rmd against a template

Description

This function compares the provided Rmd against a template and reports on discrepancies (e.g. missing or unmodified components).

Usage

rmd_check_template(rmd, template, ...)

Value

Invisibly returns TRUE if the rmd matches the template, FALSE otherwise.

Arguments

rmd

The rmd to be check, can be an rmd_ast, rmd_tibble, or text that can be handled by parse_rmd.

template

rmd_template object from rmd_template().

...

Unused, for extensibility.

Examples

Run this code
tmpl = parse_rmd(system.file("hw01.Rmd", package = "parsermd")) %>%
  rmd_select(by_section(c("Exercise *", "Solution"))) %>%
  rmd_template(keep_content = TRUE)

rmd_check_template(
  system.file("hw01-student.Rmd", package = "parsermd"),
  tmpl
)

Run the code above in your browser using DataLab