Skip to content

Can you make callouts collapsable by default? #2869

Discussion options

You must be logged in to vote

I am not sure there's a straightforward YAML option to do this, but I can offer a solution using Lua filter.

_quarto.yml

project:
  type: book
  
book:
  title: "Quarto Book"
  chapters:
    - index.qmd
    - callouts.qmd
  
format: html

callouts.qmd

---
filters: 
 - callouts.lua
---

# Callout Blocks

:::{.callout-note}
Note that there are five types of callouts, including:
`note`, `warning`, `important`, `tip`, and `caution`.
:::

:::{.callout-tip}
## Tip With Caption

This is an example of a callout with a caption.
:::

:::{.callout-caution}
## 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…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@malcolmbarrett
Comment options

Answer selected by malcolmbarrett
Comment options

You must be logged in to vote
3 replies
@haxfn
Comment options

@mcanouil
Comment options

mcanouil May 2, 2025
Collaborator

@haxfn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
extensions relates to Quarto extensions mechanism callouts Issues with Callout Blocks. html Issues with HTML and related web technology (html/css/scss/js)
5 participants