knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(govspeakr)
Callout boxes are a way to highlight important information in a document. They are often used to draw attention to key points or to provide additional context. On Whitehall publisher, callout boxes are often used to highlight key pieces of information for the user, and are indicated with $CTA
tags before and after the text.
The callout_box
function in the govspeakr
package allows you to add callout boxes to your govspeak documents. The function takes two arguments: text
and format
. The text
argument is the text you want to display in the callout box, and the format
argument specifies the format in which you want the govspeak callout box to be displayed.
Additionally, if the specified format is not HTML, but a HTML output is also produced, the HTML output will include a CSS-formatted callout box which aims to replicate the visual appearance of the callout box as it appears on gov.uk. For any other formats, the callout box will be displayed as simple text.
Examples of how this might work are shown below:
##This will display the $CTA tags in the HTML output and plain text in any other format callout_box("This is a callout box") #This will display the $CTA tags in the word output and a nicely CSS-formatted box in the HTML output callout_box("This is a callout box", "word")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.