| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/yaml.R |
| 3 |
\name{yaml_body} |
| 4 |
\alias{yaml_body} |
| 5 |
\title{Partition the YAML metadata and the body in a document} |
| 6 |
\usage{ |
| 7 |
yaml_body(x, ..., parse = TRUE) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{x}{A character vector of the document content.} |
| 11 |
|
| 12 |
\item{...}{Arguments to be passed to \code{yaml_load()}.} |
| 13 |
|
| 14 |
\item{parse}{Whether to parse the YAML data.} |
| 15 |
} |
| 16 |
\value{ |
| 17 |
A list of components \code{yaml} (the YAML data), \code{lines} (starting and |
| 18 |
ending line numbers of YAML), and \code{body} (a character vector of the body |
| 19 |
text). If YAML metadata does not exist in the document, the components |
| 20 |
\code{yaml} and \code{lines} will be missing. |
| 21 |
} |
| 22 |
\description{ |
| 23 |
Split a document into the YAML metadata (which starts with \verb{---} in the |
| 24 |
beginning of the document) and the body. |
| 25 |
} |
| 26 |
\examples{ |
| 27 |
xfun::yaml_body(c("---", "title: Hello", "output: litedown::html_format", "---", |
| 28 |
"", "Content.")) |
| 29 |
} |