For example:
#' ```
#' r <- reactive({ compute(bigdata()) } %>%
#' bindCache({ extract_most_recent_time(bigdata()) })
#' ```
https://github.com/rstudio/shiny/blob/6f46b847e2efb74a0cb82edee4d1c60658d8c9e1/R/bind-cache.R#L60-L63
turns into:
\if{html}{\out{<div class="sourceCode NA">}}\preformatted{r <- reactive(\{ compute(bigdata()) \} \%>\%
bindCache(\{ extract_most_recent_time(bigdata()) \})
}\if{html}{\out{</div>}}
https://github.com/rstudio/shiny/blob/6f46b847e2efb74a0cb82edee4d1c60658d8c9e1/man/bindCache.Rd#L66-L68
(Note that in the linked code above, it was generated with roxygen2 7.1.1 and does not have the sourceCode class, but the NA issue is still present.)
If ```R is used to open the code block, then it (correctly) turns into class="sourceCode R".
Update: Are curly braces (like ```{r, eval=FALSE}) needed for syntax highlighting?
For example:
https://github.com/rstudio/shiny/blob/6f46b847e2efb74a0cb82edee4d1c60658d8c9e1/R/bind-cache.R#L60-L63
turns into:
https://github.com/rstudio/shiny/blob/6f46b847e2efb74a0cb82edee4d1c60658d8c9e1/man/bindCache.Rd#L66-L68
(Note that in the linked code above, it was generated with roxygen2 7.1.1 and does not have the
sourceCodeclass, but theNAissue is still present.)If
```Ris used to open the code block, then it (correctly) turns intoclass="sourceCode R".Update: Are curly braces (like
```{r, eval=FALSE}) needed for syntax highlighting?