-
-
Save baptiste/ddd8fe83f9413001bb96e56178181dff to your computer and use it in GitHub Desktop.
Revisions
-
baptiste revised this gist
Feb 9, 2023 . 2 changed files with 12 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,11 @@ ```{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) ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,18 @@ --- 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') ``` -
daranzolin created this gist
Feb 9, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ ```{r} path <- fs::path("mtcars", ext = "csv") cmd <- paste0("{{< downloadthis ", "'", path, "'", ' dname=Mtcars label="Download the mtcars data" icon=database-fill-down type=info class=data-button id=mtcars >}}') ``` ```{r} #| results: asis cat(cmd) ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ --- title: "template" format: html --- ```{r} #| results = "asis" src = knitr::knit_expand('child.qmd') res = knitr::knit_child(text = unlist(src), quiet = TRUE) cat(res, sep = '\n') ```