Customizing Details

library(details)

You can customize the details output:

  1. Customizing the title
  2. Controlling if it is opened or closed
  3. Customizing the Tooltip
  4. Setting the highlight language
  5. Toggling off the language

Default

  R.version %>%
  details::details()

               _                           
platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          4.2                         
year           2024                        
month          10                          
day            31                          
svn rev        87279                       
language       R                           
version.string R version 4.4.2 (2024-10-31)
nickname       Pile of Leaves              


Title

R.version.string %>%
  details::details(
    summary = 'R Version'
  )
R Version

R version 4.4.2 (2024-10-31)


Manipulating the title style

R.version.string %>%
  details::details(
    summary = '<font color="red"> R Version </font>'
  )
R Version

R version 4.4.2 (2024-10-31)


Open

R.version.string %>%
  details::details(
    summary = 'Open by default',
    open = TRUE
  )
Open by default

R version 4.4.2 (2024-10-31)


Tooltip

R.version.string %>%
  details::details(
    summary = 'Use the current date as the tooltip',
    tooltip = Sys.Date()
  )
Use the current date as the tooltip

R version 4.4.2 (2024-10-31)


Language


readLines(
  'https://raw.githubusercontent.com/metrumresearchgroup/covrpage/master/_pkgdown.yml'
  )%>%
  details::details(
    summary = 'yaml example',
    lang = 'yml'
    )
yaml example

title: covrpage

development:
  mode: auto

template:
  params:
    bootswatch: flatly

navbar:
  type: inverse
  right:
    - icon: fa-github fa-lg
      href: https://github.com/yonicd/covrpage
  structure:
    left:  [home, reference, articleindex, news]
    right: [github, twitter]
  components:
    articles: ~
    articleindex:
      text: Articles
      href: articles/index.html
    twitter:
      icon: fa-lg fa-twitter
      href: http://twitter.com/yoniceedee

hexURL:
  https://github.com/yonicd/covrpage/blob/master/inst/logo/covrpageLogoSCREEN.png?raw=true

reference:
  - title: "Setup"
    contents:
      - has_concept("setup")
  - title: "Invoking"
    contents:
      - has_concept("invoke")
  - title: "Covrpage Trends"
    contents:
      - has_concept("log")
  - title: "Covrpage Utilities"
    contents:
      - has_concept("utility")

articles:
  - title: "Basics"
    contents:
      - get-started
      - how-to-read-covrpage-report
  - title: "Advanced"
    contents:
      - Continuous_Integration
      - snapshots
  - title: "The Output"
    contents: 
      - tests_and_coverage      


Raw


details::details(
'<h1 style="color:blue;">This is a Blue Heading</h1><br>
<p style="border: 1px solid powderblue;">There is a border around the text</p>',
summary = 'Raw code example',
lang = 'none'
)
Raw code example

This is a Blue Heading


There is a border around the text