-
DescriptionRMarkdown has a handy way of using the I can use |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This knitr recipe should work in a quarto document. Are you trying to use this in a specific context though ? Here is a working quarto document ---
title: "Reproducible Quarto Document"
format: html
execute:
echo: false
---
# Content 1
```{r}
plot(mtcars)
```
# Content 2
```{r}
head(mtcars)
```
# Appendix: All code for this report
```{r ref.label=knitr::all_labels()}
#| echo: true
#| eval: false
``` For last chunk, I am missing Yaml option and usual knitr syntax, because you need ```{r}
#| echo: true
#| eval: false
#| ref-label: !expr knitr::all_labels()
``` but
A note on this: this works for any document that it rendered on the same knitting process. This means that you can do that as the last chunk of a book project document and expect all codes from the book to be included. You need to code around it in that case as each .qmd is knitted in its own independant process. Hope it helps |
Beta Was this translation helpful? Give feedback.
-
Yup. that works! I was doing this:
Didn't realize that it wouldn't be evaluated with that syntax. I prefer the first syntax:
Works like a charm! |
Beta Was this translation helpful? Give feedback.
-
For anyone who ends up here, I made a lua filter for this use case. See the |
Beta Was this translation helpful? Give feedback.
This knitr recipe should work in a quarto document. Are you trying to use this in a specific context though ?
Can you share an example ?
Here is a working quarto document
For last chunk, I am missing Yaml option and usual knitr syntax, because you need
knitr::all_labels()
to be evaluatedFull YAML syntax would look like
but