Set 'code-tools: source:' to load .R file in same folder as .qmd #5132
-
Hello, I want to use code-tools to make the source code available but only with the .R code (not the .qmd), which I am generating with knitr::purl(" .qmd"). But I am not managing to configure the .yml to load the .R file. I saw some examples to set a url or repo, but that would not be the case, because the .R file is generated in the same folder as the .qmd. Seems like something simple, but I still can't figure it out. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You could try this Quarto extension: https://github.com/shafayetShafee/downloadthis
You can probably add a download button that would help download your R file. The built in code tools feature is for the Qmd source code only. |
Beta Was this translation helpful? Give feedback.
-
Note that instead of extracting the R code from the Quarto document, you could do the opposite, read the code chunks from an R script, see https://bookdown.org/yihui/rmarkdown-cookbook/read-chunk.html. Then as suggested you can use the extension "downloadthis" to ease code download. |
Beta Was this translation helpful? Give feedback.
You could try this Quarto extension: https://github.com/shafayetShafee/downloadthis
You can probably add a download button that would help download your R file.
The built in code tools feature is for the Qmd source code only.