Src: How to add collapsible section in Mardown - Github
1. Example
Click me
Heading
- Foo
- Bar
- Baz
- Qux
Some Javascript
2. Code/Markdown
3. Tips & Tricks
Discover some handy customizations for your collapsible sections.
3.1 Expand by Default
To have a collapsible section expanded by default, simply include the ‘open’ attribute within the <details>
tag:
Hello
World!3.2 Customize Clickable Text
You can modify the appearance of the clickable text by adding styling inside the <summary>
tags:
Wow, so fancy
WOW, SO BOLD3.3 Nested Collapsible Sections
NB: When including headings within collapsible sections, remember to add a new line after the <summary>
tag.
Section A
Section A.B
Section A.B.C
Section A.B.C.D
Done!Troubleshooting
- If certain markdown or styling, such as
# My Title
, fails to render in the collapsible section, try adding a line break after the</summary>
tag. - If your section fails to render, it might be malformed. Consider copying the functional examples provided here and building from there!