Folding GitHub

The title is imitate 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.

How?

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

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

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

And you can also provide contributor guideline and issue template!

Thanks for reading!