About this example
This document shows how to make callouts collapsible by default using a Lua filters since 1.3 has introduced new Custom AST nodes.
function Callout(el)
  if quarto.doc.isFormat("html") then
    -- Set default collapse to true if unset
    if not el.collapse then
      el.collapse = true
    end
    return el
  end
endCallout Blocks
Note
Note that there are five types of callouts, including: note, warning, important, tip, and caution.
Tip With Caption
This is an example of a callout with a caption.
Expand To Learn About Collapse
This is an example of a ‘folded’ caution callout that can be expanded by the user. You can use collapse="true" to collapse it by default or collapse="false" to make a collapsible callout that is expanded by default.
Important
This is important