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-apple-darwin17.0     
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
status                                     
major          4                           
minor          1.0                         
year           2021                        
month          05                          
day            18                          
svn rev        80317                       
language       R                           
version.string R version 4.1.0 (2021-05-18)
nickname       Camp Pontanezen             


Title

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

R version 4.1.0 (2021-05-18)


Manipulating the title style

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

R version 4.1.0 (2021-05-18)


Open

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

R version 4.1.0 (2021-05-18)


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.1.0 (2021-05-18)


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