quarto / knitr 显示包括属性的代码块

huangapple go评论78阅读模式
英文:

quarto / knitr show code block including attributes

问题

"我正在编写一个关于使用quarto的网页,我想包含代码块,带有代码属性,例如:

#| eval: false
teacher_df %>%
  head(3)

但当我在网页中编写这个时,它显示为:

teacher_df %>%
  head(3)
```"

<details>
<summary>英文:</summary>

I&#39;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 %&gt;% 
      head(3)
    ```

but when I write this in a webpage it appears as so:

    teacher_df %&gt;% 
      head(3)

</details>


# 答案1
**得分**: 2

```markdown
`r &#39;&#39;````{r tables-mtcars}
knitr::kable(iris[1:5, ], caption = &#39;A caption&#39;)

<details>
<summary>英文:</summary>

Try:

    ````markdown
    `r &#39;&#39;````{r tables-mtcars}
    knitr::kable(iris[1:5, ], caption = &#39;A caption&#39;)
    ```
    ````


</details>



huangapple
  • 本文由 发表于 2023年7月3日 04:32:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/76600682.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定