Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ZhipingYang/c1a9c0835aa0c1630487bf6fa134078b to your computer and use it in GitHub Desktop.
Save ZhipingYang/c1a9c0835aa0c1630487bf6fa134078b to your computer and use it in GitHub Desktop.
How to add a collapsible section in markdown.

A collapsible section with markdown

Click to expand!

Heading

  1. A numbered
  2. list
    • With some
    • Sub bullets

A collapsible section with code

Click to expand!
  function whatIsLove() {
    console.log('Baby Don't hurt me. Don't hurt me');
    return 'No more';
  }

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.

Make collapsible section default opened

Note:
all the UIKit's accessibilityIdentifier is a preperty of the protocol UIAccessibilityIdentification and all enum's rawValue is default to follow RawRepresentable

Expand for steps details
  • 1.1 Define the enums
    • set rawValue in String
    • append PrettyRawRepresentable if need
  • 1.2 set UIKit's accessibilityIdentifier by enums's rawValue
    • method1: infix operator
    • method2: UIAccessibilityIdentification's extension
  • 1.3 Apply in UITest target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment