how to access yaml metadata from knitr
Asked Answered
B

1

14

Does knitr know the value of YAML data e.g. title: or date: or some_custom_field: while it is compiling an rmarkdown doc with a YAML header?

I would like to be able to do this (pseudocode)

---
title: my title
---

The title of this document is `r knitrs_yaml_array("title")`
Barksdale answered 4/7, 2015 at 13:2 Comment(0)
G
19

That is stored in rmarkdown::metadata as a list of the form list(title = ...).

Glasshouse answered 5/7, 2015 at 2:29 Comment(1)
Is there a way to modify rmarkdown::metadata on the fly? Within a report constructed from modules/child documents , I would like to augment the abstract module-specific as the module is evaluated (or not).Shermanshermie

© 2022 - 2024 — McMap. All rights reserved.