Skip to content

Instantly share code, notes, and snippets.

@baptiste
Forked from daranzolin/child.qmd
Created February 9, 2023 02:48
Show Gist options
  • Save baptiste/ddd8fe83f9413001bb96e56178181dff to your computer and use it in GitHub Desktop.
Save baptiste/ddd8fe83f9413001bb96e56178181dff to your computer and use it in GitHub Desktop.
```{r}
path <- fs::path("<<variable>>", ext = "csv")
cmd <- paste0("{{< downloadthis ", "'", path, "'", ' dname=<<variable>> label="Download the <<variable>> data" icon=database-fill-down type=info class=data-button id=<<variable>> >}}')
```
```{r}
#| results: asis
cat(cmd)
```
---
title: "testchild.qmd"
format: html
extension: downloadthis
---
## Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
```{r}
#| results = "asis"
variable <- 'dudewhereismy'
src = knitr::knit_expand("child.qmd", delim = c("<<", ">>"))
res = knitr::knit_child(text = unlist(src), quiet = TRUE)
cat(res, sep = '\n')
```
@baptiste
Copy link
Author

baptiste commented Feb 9, 2023

Screenshot 2023-02-09 at 15 49 19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment