How to create a markdown list with:
- each item being collapsible or not
- items are indented, sub-items are indented 2 times etc ...
- each item "body" containing at each level having the ability to carry regular md, including sub-list, also collapsible.. etc
this page presents some solutions, but the most viable one is pure HTML, there no point of MD anymore
We have to play with
details,summary, and ... spaces! Spaces?? Yes:detailstag on the closing line.</details>tag must be indented as if it was part of the "body" of your<detail>.Spaces are what makes it work, or not.
Here is a 2-level list with collapsable elements, and sub-elements, with some other regular markdown items.
Example rendered in github. Works on VS-Code too. Not sure which other engine supports it.
The code:
As you can see, not all engines supports it though... like SO one:
a. with another list b. and some other stuff d. and, more, classic, [md] e. no need of html
blablabla
a random not collapsable section
...
some parent content
and another list
and some content
and some content
section 2.3 and some no collapsed content