R in frontmatter with custom listing template #2202
Answered
by
mcanouil
nurfatimaj
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
mcanouil
Aug 31, 2022
Replies: 2 comments 10 replies
-
To use R code in YAML, you have to use But the issue might also be related to #1505. |
Beta Was this translation helpful? Give feedback.
8 replies
-
Here is an alternative, which basically includes the yaml (everything or only few selected fields) from another document within the Quarto document. ---
format: html
params:
project-path: "."
---
```{r}
#| output: asis
#| echo: false
cat(
"---",
yaml::as.yaml(
rmarkdown::yaml_front_matter(
input = list.files(
path = params[["project-path"]],
pattern = 'index.Rmd',
full.names = TRUE
)[c("title", "any_other_field")]
)
),
"---",
sep = "\n"
)
``` |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
nurfatimaj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is an alternative, which basically includes the yaml (everything or only few selected fields) from another document within the Quarto document.