Getting Started with Paligo

Creating Accordions in HTML5

Accordions are sections of content that can be expanded or collapsed in HTML5 output. This can be useful for example if you have content that is not always necessary to be fully visible immediately, because it's auxiliary information, might disturb the flow of reading or the like, but still needed.

Creating accordions is enabled for section and sidebar elements.

Whatever the reason, it's easy to create this expandable/collapsible content in HTML5 output:

  1. Select a section (as an internal element in a topic) or sidebar element that you want output as an accordion in HTML5. 

    This also works on topics (sections) reused in another topic.

  2. Add a role attribute, and give it the value "accordion".

That's it. When you publish to HTML5, these sections or sidebars will now appear as expandable/collapsible accordions.

In the sample topic in the image, the title "A brief history of spaceflight" is clickable, and expands to show the content underneath.

Note

Marking topics, sections, or sidebars up for accordion output in HTML5 does not affect other outputs, such as PDF, where this content will show as regular content.