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

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

quarto / knitr show code block including attributes

问题

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

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

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

  1. teacher_df %>%
  2. head(3)
  3. ```"
  4. <details>
  5. <summary>英文:</summary>
  6. I&#39;m writing a webpage on using quarto and I want to include code blocks, with the code attributes, for example:
  7. ```{r}
  8. #| eval: false
  9. teacher_df %&gt;%
  10. head(3)
  11. ```
  12. but when I write this in a webpage it appears as so:
  13. teacher_df %&gt;%
  14. head(3)
  15. </details>
  16. # 答案1
  17. **得分**: 2
  18. ```markdown
  19. `r &#39;&#39;````{r tables-mtcars}
  20. knitr::kable(iris[1:5, ], caption = &#39;A caption&#39;)
  1. <details>
  2. <summary>英文:</summary>
  3. Try:
  4. ````markdown
  5. `r &#39;&#39;````{r tables-mtcars}
  6. knitr::kable(iris[1:5, ], caption = &#39;A caption&#39;)
  7. ```
  8. ````
  9. </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:

确定