英文:
quarto / knitr show code block including attributes
问题
"我正在编写一个关于使用quarto的网页,我想包含代码块,带有代码属性,例如:
#| eval: false
teacher_df %>%
head(3)
但当我在网页中编写这个时,它显示为:
teacher_df %>%
head(3)
```"
<details>
<summary>英文:</summary>
I'm writing a webpage on using quarto and I want to include code blocks, with the code attributes, for example:
```{r}
#| eval: false
teacher_df %>%
head(3)
```
but when I write this in a webpage it appears as so:
teacher_df %>%
head(3)
</details>
# 答案1
**得分**: 2
```markdown
`r ''````{r tables-mtcars}
knitr::kable(iris[1:5, ], caption = 'A caption')
<details>
<summary>英文:</summary>
Try:
````markdown
`r ''````{r tables-mtcars}
knitr::kable(iris[1:5, ], caption = 'A caption')
```
````
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论