extract_yaml_fragments {yum} | R Documentation |
Extract all YAML fragments from a file
Description
These function extracts all YAML fragments from a file, returning a list of character vectors containing the extracted fragments.
Usage
extract_yaml_fragments(
text,
file,
delimiterRegEx = "^---$",
ignoreOddDelimiters = FALSE,
encoding = "UTF-8",
silent = TRUE
)
Arguments
text , file |
As |
delimiterRegEx |
The regular expression used to locate YAML fragments. |
ignoreOddDelimiters |
Whether to throw an error (FALSE) or delete the last delimiter (TRUE) if an odd number of delimiters is encountered. |
encoding |
The encoding to use when calling |
silent |
Whether to be silent ( |
Value
A list of character vectors, where each vector corresponds to one YAML fragment in the source file or text.
Examples
extract_yaml_fragments(text="
---
First: YAML fragment
id: firstFragment
---
Outside of YAML
---
Second: YAML fragment
id: secondFragment
parentId: firstFragment
---
Also outside of YAML
");