Accordion Revealjs Test

Testing the accordion shortcode in revealjs

Roy Francis

09-Apr-2026

S1: YAML simple single item

{{< accordion yaml-simple >}}
This content is defined in the document yaml

S2: YAML multiple items

{{< accordion yaml-many-items >}}
This is the body content for item 1
This is the body content for item 2
This is the body content for item 3

S3: YAML collapsed state

First item collapsed (default), second item expanded.

{{< accordion yaml-collapsed >}}
Collapsed body content
Expanded body content

S4: YAML custom id

{{< accordion yaml-custom-id >}}
Custom id body

S5: YAML markdown formatting

{{< accordion yaml-markdown >}}
This is bold and italic

S6: YAML multiline markdown

{{< accordion yaml-multiline-markdown >}}

This is multiline content.

This is bold and italic.

  • List item 1
  • List item 2

S7: Inline simple

{{< accordion header="Click to expand" body="This content is defined inline." >}}
This content is defined inline.

S8: Inline collapsed false

{{< accordion header="This starts expanded" body="Expanded content by default." collapsed="false" >}}
Expanded content by default.

S9: Inline with custom id

{{< accordion header="Custom item id" body="Custom ids are useful for anchor links." id="custom-item-revealjs" >}}
Custom ids are useful for anchor links.

S10: Inline multi items via JSON

{{< accordion items='[{"header":"Inline Item 1","body":"Content for item 1."},{"header":"Inline Item 2","body":"Content for item 2.","collapsed":false}]' >}}
Content for item 1.
Content for item 2.

S11: Inline markdown formatting

{{< accordion header="**Bold header**" body="This is **bold** and *italic*" >}}
This is bold and italic

S12: Multiple accordions on one slide

Body of first accordion on this slide.
Body of second accordion on this slide.
Body of third accordion on this slide.

E1: No arguments

{{< accordion >}}

Accordion Error: No arguments provided. Provide contents either as yaml metadata (positional argument) or inline (header/body/items kwargs).

E2: Both positional and label kwargs

{{< accordion yaml-simple label="mixed" header="Header" body="Body" >}}

Accordion Error: Use either a positional argument or named arguments (label), not both.

E3: Invalid label

{{< accordion label="invalid label" header="Header" body="Body" >}}

Accordion Error: 'invalid label': Label contains invalid characters. Only letters, numbers, dashes (-) and underscores (_) are allowed.

E4: YAML label not found

{{< accordion nonexistent >}}

Accordion Error: 'nonexistent': Accordion entry not found in yaml metadata.

E5: YAML empty metadata

{{< accordion yaml-empty >}}

Accordion Error: 'yaml-empty': Missing 'header' and 'body'.

E6: YAML missing header

{{< accordion yaml-missing-header >}}
Accordion Error: 'yaml-missing-header': Item 1 is missing 'header'.

E7: YAML missing body

{{< accordion yaml-missing-body >}}
Accordion Error: 'yaml-missing-body': Item 1 is missing 'body'.

E8: Inline missing body

{{< accordion header="Header only" >}}

Accordion Error: 'acc-ddadddd0': 'body' kwarg is missing.

E9: Inline missing header

{{< accordion body="Body only" >}}

Accordion Error: 'acc-993eba75': 'header' kwarg is missing.