Text in the button to Show/hide code

The output of the code that I include at the end, taken from the 1st section of

is shown on that page with buttons to hide/show the code for each chunk that are labeled "code".
When I knit to html the same code myself, the button at the top right of the chunk is labeled "Show", which I am finding that is inconvenient for other people reading my work: they are just unaware that the code is actually there.
How could I get the text of the buttons to be "Code" as in the example (or even better "Show Code")?
Output reproduced in the web page

My output

Code:


---
title: "Code Collapse Demonstration"
output:
  html_document:
    code_folding: hide
---

```{r}
#| include = FALSE
library(dplyr)
library(ggplot2)

There is a negative correlation between horsepower and miles per gallon.

mtcars %>% 
  ggplot(aes(x = hp, y = mpg)) +
  geom_point()

Unfortunately, there is no configuration available to customize this value. And FWIW it was changed from Code to Show last year.

Only way to customize this, is to use some JS code to dynamically modify the content in browser. There are probably several way to do it, one of them is adding or overdding the current event added using boostrap on those button. Maybe there is example out there, otherwise I could try look at it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.