get_revision: Extract Tagged Text from a Manuscript

View source: R/get_revision.R

get_revisionR Documentation

Extract Tagged Text from a Manuscript

Description

Retrieves and formats a specified section from a revise_manuscript object based on its ID.

Usage

get_revision(
  id,
  manuscript = NULL,
  quote = TRUE,
  evaluate = TRUE,
  split_string = FALSE,
  search_length = 300,
  include_pgnum = TRUE,
  revise_errors = getOption("revise_errors"),
  envir = parent.frame(1L)
)

Arguments

id

the id as a character string from a html or markdown tag

manuscript

Optional; a revise_manuscript object in which to search for id. Defaults to NULL, in which case the manuscript object is found in the environment.

quote

should the output string be quoted by inserting '>' before the string?

evaluate

logical. Should inline rchunks be executed?

split_string

should only the start and end of the string be searched for?

search_length

numeric. Searches for the first n and n characters in a string. Shorten if difficult to find passages split by floats.

include_pgnum

logical. include PDF page number? Requires a PDF to be provided to the manuscript object.

revise_errors

logical. If FALSE, failure to match manuscript sections will result in warnings rather than errors.

envir

The environment in which to find the manuscript.

Value

A character vector of length 1 containing the text extracted from the manuscript that was tagged with id, including any modifications as specified by the arguments.


revise documentation built on April 3, 2025, 11:47 p.m.