read_manuscript {revise} | R Documentation |
Read 'Rmarkdown' Manuscript
Description
Reads an 'Rmarkdown' manuscript and, if possible, an associated PDF.
Usage
read_manuscript(
path,
PDF = FALSE,
to_envir = getOption("revise_use_envir", TRUE),
envir = parent.frame(1)
)
Arguments
path |
Character, path to the 'Rmarkdown' file. |
PDF |
Logical or character. Default |
to_envir |
Logical, indicating whether or not the manuscript should
be invisibly assigned to an environment variable names |
envir |
The environment to which the manuscript should be assigned. |
Details
If to_envir
is TRUE
, the manuscript is invisibly assigned to the specified environment for later use by other revise functions. For example, this allows get_revision
to work without specifying a manuscript. This behaviour can be disabled by setting options(revise_use_envir = FALSE)
.
Value
Invisibly returns a list of class manuscript
, containing
the following elements:
$sections: Extracted revisions
$PDF: Optionally, the PDF document
$refs: References to figures and tables
$rmd: The raw rmarkdown
$mtime: When the rmarkdown file was last modified
$checksum: A checksum of the rmarkdown file
$filename: The filename of the rmarkdown file
See Also
Examples
tempfile <- tempfile("tmp", fileext = ".txt")
writeLines("[Maecenas mollis consectetur purus.]{#test}", con = tempfile)
read_manuscript(tempfile)