# Create a simple temporary YAML file containing a title
tmp_file <- tempfile(fileext = ".yml")
readr::write_lines("title: Encyclopédie", tmp_file)
# View the temporary file
cat(readr::read_file(tmp_file))
# Create a PlumeQuarto instance using the temporary file
# we've just created
aut <- PlumeQuarto$new(
encyclopedists,
file = tmp_file
)
# And add author data to the YAML file
aut$to_yaml()
cat(readr::read_file(tmp_file))
# Running the method again with new data updates the YAML
# accordingly
aut <- PlumeQuarto$new(
dplyr::slice(encyclopedists, 2),
file = tmp_file
)
aut$to_yaml()
cat(readr::read_file(tmp_file))
# Clean up
unlink(tmp_file)
Run the code above in your browser using DataLab