View source: R/read_manuscript.R
read_manuscript | R Documentation |
Reads an 'Rmarkdown' manuscript and, if possible, an associated PDF.
read_manuscript(
path,
PDF = FALSE,
to_envir = getOption("revise_use_envir", TRUE),
envir = parent.frame(1)
)
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. |
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)
.
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
yaml_front_matter
fileutils
tempfile <- tempfile("tmp", fileext = ".txt")
writeLines("[Maecenas mollis consectetur purus.]{#test}", con = tempfile)
read_manuscript(tempfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.