How to write fold/unfold comments on GitHub

twitter logo github logo ・1 min read

When you describe long code such as error logs or measurement result on GitHub, you may want to create collapsed elements.

fold/unfold elements can be created by <details> tag.

For example, if you write the following source code, you will see the following description.

<details>
<summary>Title</summary>
<pre>
<code>
Detailed Information
Detailed Information
Detailed Information
</pre>
</code>
</details>

sample1

twitter logo DISCUSS
Classic DEV Post from Nov 26 '18

Who's looking for open source contributors? (November 26th edition)

Find something to work on or promote your project here. Please shamelessly pro...

Toshiharu Nishina profile image
A web developer for the fifth year.Rails/React/GraphQL.

Creating your DEV account literally takes 30 seconds and is one of the best moves you can make for a happy and healthy software career.

Get started now ❤️