Our internal git-lab wiki works with Markdown. I made several summaries of articles and want to post them in our wiki, in such a way that if I click on the header, it should unfold and the text should become visible, basically like in this example
Does Markdown have this expand/collapse/fold function?
Short Answer: No, Markdown does not offer a feature like that directly, but with some work you might be able to build something that works.
Ideally, each collapsible section would be wrapped in a div:
<div id="section1"> <h1>Section 1</h1> <p>Section 1 content</p> <div id="section1-1"> <h2>Section1-1</h2> <p>section 1-1 content</p> </div> <div id="section1-2"> <h2>Section1-2</h2> <p>section 1-2 content</p> </div> </div>
<h1>Section 1</h1> <p>Section 1 content</p> <h2>Section1-1</h2> <p>section 1-1 content</p> <h2>Section1-2</h2> <p>section 1-2 content</p>
A solution would require looping through the entire document, breaking it up into the various sections and wrapping each section in divs. You can find a couple examples of that as Extensions to the Python-Markdown Parser. However, with any information regarding the environment you are working in, It is a little more difficult to point you in the correct direction. Besides, Stackoverflow is not supposed to be a tool recommendation site. However, by observing how others have solved the problem (in the examples I pointed to) you should be able to work out a similar solution.