R/parts.R

Defines functions body_details end_details start_details

start_details <- function(state,summary){
  sprintf('<details %s>%s',state, summary)
}

end_details <- function(){
  paste('</details>','<br>',sep='\n')
}

body_details <- function(lang,text){
  
  if(!details_env$device){
    
    text <- sprintf('\n\n%s\n\n',text)
    
    if(is.null(lang)){
      message("NULL is being deprecated for this feature, please use 'none'")
      lang <- 'none'
    }
      
    if(!grepl('^none$',lang))
      text <- sprintf('```%s%s```',lang,text)
    
  }
    
  text
    
}

Try the details package in your browser

Any scripts or data that you put into this service are public.

details documentation built on March 28, 2022, 1:06 a.m.