rmd_template {parsermd}R Documentation

Create a template from an rmd object.

Description

Templates are objects which are meant to capture the structure of an R Markdown document and facilitate the comparison between the template and new Rmd documents, usually to ensure the structure and/or content matches sufficiently.

Usage

rmd_template(
  rmd,
  keep_content = FALSE,
  keep_labels = TRUE,
  keep_headings = FALSE,
  keep_yaml = FALSE,
  ...
)

Arguments

rmd

R Markdown document in the form of an rmd_ast or rmd_tibble.

keep_content

Should the template keep the document's content (markdown text and chunk code).

keep_labels

Should the template keep the document's code chunk labels.

keep_headings

Should the template keep the document's headings.

keep_yaml

Should the template keep the document's yaml.

...

Unused, for extensibility.

Value

Returns an rmd_template object, which is a derived tibble containing relevant structural details of the document.

Examples

rmd = parse_rmd(system.file("hw01.Rmd", package="parsermd"))

rmd_select(rmd, by_section(c("Exercise *", "Solution"))) %>%
  rmd_template()

[Package parsermd version 0.1.3 Index]