Folding GitHub

The title is imitating this book: Folding Beijing.

Fold long content on GitHub Flavored Markdown.

Today I learned a trick from apple/swift's Pull Request template that you can fold long content in a <details> tag:

When you click the triangle, will toggle the folding content:

So that you can fold contents that only need to see when necessary.

Wrap your long content in details tag and provide a summary:

<summary>The title for folding content</summary>
very long content starts here
very long content ends here

See the real-world example from apple/swift's Pull Request template.

And you can also provide contributor guideline and issue template!