yaml_body: Partition the YAML metadata and the body in a document

View source: R/yaml.R

yaml_bodyR Documentation

Partition the YAML metadata and the body in a document

Description

Split a document into the YAML metadata (which starts with ⁠---⁠ in the beginning of the document) and the body. The YAML metadata will be parsed.

Usage

yaml_body(x)

Arguments

x

A character vector of the document content.

Value

A list of components yaml and body.

Examples

xfun::yaml_body(c("---", "title: Hello", "output: markdown::html_document", "---",
    "", "Content."))

xfun documentation built on Nov. 2, 2023, 6 p.m.