Skip to content

Instantly share code, notes, and snippets.

@nolvuscodes
Created April 9, 2023 08:07
Show Gist options
  • Save nolvuscodes/6674e22f3079b0f6dc601c21c27cc5a8 to your computer and use it in GitHub Desktop.
Save nolvuscodes/6674e22f3079b0f6dc601c21c27cc5a8 to your computer and use it in GitHub Desktop.
Collapsible Markdown

How to

<details>
  <summary>Click me</summary>
  
  ### Heading
  1. Foo
  2. Bar
     * Baz
     * Qux

  ### Some Code
  ```js
  function logSomething(something) {
    console.log('Something', something);
  }
  ```
</details>

Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
    • Qux

Some Code

function logSomething(something) {
  console.log('Something', something);
}

Rules

  1. Have an empty line after the </summary> tag or markdown/code blocks will not render.
  2. Have an empty line after each </details> tag if you have multiple collapsible sections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment