Markdown: 실제 사용 사례와 활용 방법(5) - Lists 문법

오늘은 마크다운 문법 중 Lists에 대해 알아보자.
Lists에는 Ordered Lists(순서가 있는 목록)와 Unordered lists(순서가 없는 목록), 혼합 리스트가 있다.

1. Ordered Lists(순서가 있는 목록)

  • 숫자와 점을 기입하면 순서가 있는 목록이 된다.
Markdown Rendered Output
1. first
2. second
3. third
  1. first
  2. second
  3. third
  • 번호를 마음대로 입력해도, 순서대로 알아서 숫자를 매긴다.
Markdown Rendered Output
1. first
3. third
2. second
  1. first
  2. third
  3. second
  • 중첩 목록을 만들려면 들여쓰기 한다.
Markdown Rendered Output
1. first
2. second
   1. second-first
   2. second-second
3. third
  1. first
  2. second
    1. second-first
    2. second-second
  3. third

2. Unordered Lists(순서가 없는 목록)

  • *, +, - 를 이용해서 순서가 없는 목록을 만들 수 있다.
  • 중첩 목록을 만들려면 항목을 들여쓰기 한다.
Markdown Rendered Output
* first
* second
* third
  • first
  • second
  • third
+ first
+ second
+ third
  • first
  • second
  • third
- first
- second
- third
  • first
  • second
  • third
- first
- second
   - second-first
   - second-second
- third
  • first
  • second
    • second-first
    • second-second
  • third

3. 혼합 리스트

Markdown Rendered Output
1. first
   + first-first
   * first-second
2.second
   - second-first
     1. second-second
  1. first
    • first-first
    • first-second
  2. second
    • second-fisrt
      1. second-second

참조 사이트

  1. https://www.markdownguide.org/basic-syntax/#lists-1