Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save quantumpacket/2d57c818f0654c3db9f36a77a17d9003 to your computer and use it in GitHub Desktop.

Select an option

Save quantumpacket/2d57c818f0654c3db9f36a77a17d9003 to your computer and use it in GitHub Desktop.

Revisions

  1. @pierrejoubert73 pierrejoubert73 revised this gist Oct 11, 2018. 1 changed file with 38 additions and 6 deletions.
    44 changes: 38 additions & 6 deletions markdown-details-collapsible.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,39 @@
    Your markdown heading here
    # A collapsible section with markdown
    <details>
    <summary>
    Show details
    </summary>
    Your markdown content here
    </details>
    <summary>Click to expand!</summary>

    ## Heading
    1. A numbered
    2. list
    * With some
    * Sub bullets
    </details>

    # A collapsible section with code
    <details>
    <summary>Click to expand!</summary>

    ```javascript
    function whatIsLove() {
    console.log('Baby Don't hurt me. Don't hurt me');
    return 'No more';
    }
    ```
    </details>

    # How to structure the markup
    ```
    # A collapsible section with markdown
    <details>
    <summary>Click to expand!</summary>
    ## Heading
    1. A numbered
    2. list
    * With some
    * Sub bullets
    </details>
    ```
    **NB:** Make sure you have an **empty line** after the closing `</summary>` tag.

    **NB**: Make sure you have an **empty line** after the closing `</details>` tag if you have multiple collapsible sections.
  2. @pierrejoubert73 pierrejoubert73 created this gist Jun 30, 2017.
    7 changes: 7 additions & 0 deletions markdown-details-collapsible.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Your markdown heading here
    <details>
    <summary>
    Show details
    </summary>
    Your markdown content here
    </details>