Extract meta fields from a tag
extract_meta(tags)
A single tag or vector of tags to extract the fields from.
A named vector indicating the field and entry associated with it.
### Simple example
tag <- "{quiz, id: quiz_name_here, attempts: 10}"
# Extract metadata tags
meta <- extract_meta(tag)
### Example using a file
quiz_path <- good_quiz_path()
quiz_lines <- readLines(quiz_path)
# Put this in a data.frame so we can identify the content
quiz_df <- parse_quiz_df(quiz_lines)
# Extract the tags
tags <- quiz_df %>%
dplyr::filter(type == "tag") %>%
dplyr::pull("original")
# Extract metadata tags
meta <- extract_meta(tags)