You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users can then link directly to this section with `#installation-steps`.
111
+
112
+
### Accordion Groups
113
+
114
+
Create accordion-style behavior where details elements in the same group interact with each other. Two modes are available:
115
+
116
+
#### Exclusive Mode (Default)
117
+
118
+
Only one details element can be open at a time within a group. When a user opens one section, any other open section in the same group automatically closes. This uses the native HTML `name` attribute.
119
+
120
+
```markdown
121
+
::: {.details summary="Section 1" group="faq"}
122
+
Content for section 1.
123
+
:::
124
+
125
+
::: {.details summary="Section 2" group="faq"}
126
+
Content for section 2.
127
+
:::
128
+
129
+
::: {.details summary="Section 3" group="faq"}
130
+
Content for section 3.
131
+
:::
132
+
```
133
+
134
+
#### Synchronized Mode
135
+
136
+
All details elements in a group open and close together. When a user toggles one section, all other sections in the same group follow.
Visit the online documentation at https://example.com/demo to try the interactive demo.
186
+
:::
187
+
188
+
:::
189
+
```
190
+
191
+
### Expand/Collapse Controls
192
+
193
+
Add document-wide buttons to expand or collapse all details sections at once:
194
+
195
+
```yaml
196
+
---
197
+
extensions:
198
+
details:
199
+
interactive:
200
+
show-controls: true
201
+
controls-position: "top"# "top", "bottom", or "both"
202
+
---
203
+
```
204
+
205
+
#### Control Positions
206
+
207
+
| Position | Description |
208
+
|----------|-------------|
209
+
|`"top"`| Controls appear at the beginning of the document (default) |
210
+
|`"bottom"`| Controls appear at the end of the document |
211
+
|`"both"`| Controls appear at both the beginning and end |
212
+
213
+
#### Customizing Button Text
214
+
215
+
Customize the button labels:
216
+
217
+
```yaml
218
+
---
219
+
extensions:
220
+
details:
221
+
interactive:
222
+
show-controls: true
223
+
controls-expand-text: "Show all sections"
224
+
controls-collapse-text: "Hide all sections"
225
+
---
226
+
```
227
+
228
+
> [!NOTE]
229
+
>
230
+
> Controls only appear in interactive (HTML) formats
231
+
> and only when the document contains at least one details block.
232
+
233
+
### Format-Specific Behavior
234
+
235
+
The extension automatically detects whether the output format is interactive (HTML-based) or non-interactive (PDF, Word, Typst, etc.) and adjusts its behavior accordingly.
236
+
237
+
#### Interactive Formats (HTML, RevealJS, etc.)
238
+
239
+
For HTML-based formats, the extension generates native `<details>` and `<summary>` elements with:
240
+
241
+
- Full Markdown formatting support in summaries
242
+
- Accordion group support via the `name` attribute
243
+
- Accessibility attributes (`aria-label`, `id`)
244
+
245
+
#### Non-Interactive Formats (PDF, Word, Typst, etc.)
246
+
247
+
For non-interactive formats, the extension uses Quarto's Callout API to display the content. You can configure how details blocks appear using the `display` option:
248
+
249
+
| Display Mode | Description |
250
+
|--------------|-------------|
251
+
|`"show"`| Shows the full content in a callout block (default) |
252
+
|`"placeholder"`| Shows a callout with placeholder text indicating interactive content was removed |
253
+
|`"remove"`| Completely removes the details block from the output |
254
+
255
+
## Global Configuration
256
+
257
+
Configure the extension in your document's YAML front matter using the `extensions.details` key:
258
+
259
+
```yaml
260
+
---
261
+
extensions:
262
+
details:
263
+
debug: false # Enable verbose logging
264
+
interactive:
265
+
open: false # Default open state for HTML
266
+
summary: "Click to expand"# Default summary text for HTML
267
+
accordion-mode: "exclusive"# "exclusive" or "synchronized"
268
+
show-controls: false # Show expand/collapse all buttons
269
+
controls-position: "top"# "top", "bottom", or "both"
270
+
controls-expand-text: "Expand all"
271
+
controls-collapse-text: "Collapse all"
272
+
non-interactive:
273
+
display: "show"# "show", "placeholder", or "remove"
274
+
summary: "Details"# Default summary text for non-interactive
275
+
placeholder-text: "Interactive content not available in this format."
276
+
callout-type: "note"# Callout style: note, warning, tip, caution, important
277
+
---
278
+
```
279
+
280
+
### Instance-Level Attributes
281
+
282
+
Override global settings on individual details blocks:
0 commit comments