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-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          6.3                         
year           2020                        
month          02                          
day            29                          
svn rev        77875                       
language       R                           
version.string R version 3.6.3 (2020-02-29)
nickname       Holding the Windsock        


Title

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

R Version


R version 3.6.3 (2020-02-29)


Manipulating the title style

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

R Version


R version 3.6.3 (2020-02-29)


Open

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

Open by default


R version 3.6.3 (2020-02-29)


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 3.6.3 (2020-02-29)


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
      - Test_Results
      - 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