```{css, echo=FALSE} .btn-primary, .btn-primary:active, .btn-primary:focus, .btn-primary:hover { background-color: #1e90ff!important; box-shadow: none; border: none; color: white; outline: none; padding: 8px 8px; text-align: center; text-decoration: none; display: inline-block; font-size: 14px; }

.list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover { z-index: 2; color: #fff; background-color: #1e90ff; border-color: #337ab7; }

<!-- #SETUP This create the button option in chunks -->

```r
local({
  hook_chunk <- knitr::knit_hooks$get('chunk')
  knitr::knit_hooks$set(chunk = function(x, options) {
    if (!is.null(options$button)) {
      rnd_id <- substr(tempfile("b", "", ""), 2, 9)
      paste0(
        '<button class="btn btn-primary" data-toggle="collapse" data-target="#',
        rnd_id, '">',
        options$button, '</button> <div id="',
        rnd_id, '" class="collapse">',
        x, '</div>')
    } else {
      x
    }
  })
})
knitr::opts_chunk$set(echo = TRUE,
                      message = FALSE,
                      warning = FALSE,
                      fig.align = "center",
                      fig.retina = 2,
                      #fig.width = 6,
                      #fig.asp = 0.618,
                      #out.width = "70%",
                      dev = "svg")

# set.seed() for reproducibility
# captions <- filor::get_captions()
get_chunk_label <- function(){
  knitr::opts_current$get("label")
}
library(here)
filor::get_rmd_comments(knitr::current_input(), write = TRUE) |> 
  cat(sep = "\n")


filor::session_info()


filippogambarota/filippoR documentation built on March 6, 2023, 4:22 a.m.