DEV Community

loading...

How to write fold/unfold comments on GitHub

Toshiharu Nishina
A web developer for the fifth year.Rails/React/GraphQL.
・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>
Enter fullscreen mode Exit fullscreen mode

sample1

Discussion (0)