strip_yaml_header | R Documentation |
Extracts the body from R Markdown file content, stripping a possible YAML metadata block at the beginning.
strip_yaml_header(rmd, eol = c("LF", "CRLF", "CR", "LFCR"))
rmd |
R Markdown file content as a character scalar. |
eol |
End of line (EOL) control character sequence. One of
|
Note that for the R Markdown file format, the YAML metadata block must occur at the beginning of the document (and there can be only one). Additional whitespace characters (incl. newlines) before the YAML metadata block are allowed.
Body of the R Markdown file as a character vector of lines.
Other R Markdown and knitr functions:
build_readme()
,
knitr_table_format()
rmd <- "
---
output: pal::gitlab_document
---
# A heading
Some prose.
"
pal::cat_lines(rmd)
rmd |>
pal::strip_yaml_header() |>
pal::cat_lines()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.