How can I read/parse the metadata from an rmarkdown file?

Great. Please mark the solution for the benefit of those to follow.