How to add accordion in Markdown?
  • 25 May 2023
  • 1 Minute zum Lesen
  • Mitwirkende
  • Dunkel
    Licht
  • pdf

How to add accordion in Markdown?

  • Dunkel
    Licht
  • pdf

The content is currently unavailable in German. You are viewing the default English version.
Article Summary

If you want your content to appear as an accordion in Markdown editor based articles, there is no option to add it using a conventional tool from the menu bar or a straightforward Markdown syntax.

Use the below workaround to add an accordion efforlessly in Markdown editor.


Solution

  1. Go to the desired article/page and open it in the Markdown editor
  2. Paste the below code in the desired location where you want the accordion to appear
<details>
    <summary>Accordion_name</summary>
    <p>Accordion_content</p>
    </details>
  1. Replace the Accordion_name text with the desired accordion title/name
  2. Replace the Accordion_content text with the desired content
  3. If you want to add headings inside the accordian you can use the Heading HTML tags (<h2>..</h2>, <h3>..</h3>, <h4>..</h4>) in the Accordion_content sections

Heading tags can be used in the summary section of the accordian "Accordion_name", but the text alignment might be affected.


Example

Code

<details>
    <summary>What is Document360</summary>
    <p>A well structured product to create a world class knowledge base for your customers and employees. Content producers get the power whereas the Content consumers get the simplicity.</p>
<h4>Core parts</h4>
<p>Knowledge base portal</p>
<p>Knowledge base site</p>
<p>Knowledge base widget</p>
<p>API documentation</p>

    </details>

Output

What is Document360?

A well structured product to create a world-class knowledge base for your customers and employees. With Document360 content producers get the power and flexibility, whereas the Content consumers get the simplicity.

Core parts

Knowledge base portal

Knowledge base site

Knowledge base widget

API documentation


Note: Click the "What is Document360?" accordian above to expand/collapse it.


War dieser Artikel hilfreich?