Creating Quarto documents programmatically #5373
-
I would like to create Quarto documents programmatically:
The YAML currently looks like this:
The body of the document has the following structure:
It is important to note that |
Beta Was this translation helpful? Give feedback.
Answered by
mcanouil
May 1, 2023
Replies: 1 comment 1 reply
-
Quarto documents are simple flat text files. Simply write the file with whatever you like in R. cat(sprintf(
'---
title: "Some title"
date: 09/01/2014
doi: %s
---
## Important links
- [Article](https://doi.org/{{< meta doi >}})
## DAG
```{r}
dag <- dagitty::dagitty(%s)
tidy_dag <- ggdag::tidy_dagitty(dag)
ggdag::ggdag_status(tidy_dag) +
ggdag::theme_dag()
```
',
doi_from_file,
dag_from_file
), file = 'index.qmd') quarto::quarto_render("index.qmd") Or create a template document that you can reuse (see https://quarto.org/docs/computations/parameters.html):
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lorenzoFabbri
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quarto documents are simple flat text files.
Simply write the file with whatever you like in R.
Or create a template document that you can reuse (see https://quarto.org/docs/computations/parameters.html):