3.1 KiB
Lists
Markdown supports ordered lists and unordered lists.
Unordered Lists
Use asterisk * , plus sign + or hyphen - as markers. Add a space after the marker before writing content.
- item
- item
- item
Ordered Lists
Ordered lists are used to display steps or items that require a specific sequence.
To create an ordered list, use a number followed by a period. Example:
- First item
- Second item
- Third item
Non-consecutive numbers
Markdown will automatically reorder the items even if the numbers are not consecutive:
1. First item 3. Second item (displayed as 2) 7. Third item (displayed as 3)
- First item
- Second item (displayed as 2)
- Third item (displayed as 3)
Start from a specified number
- Fifth item
- Sixth item
- Seventh item
Nested Lists
Lists support nesting to build multi-level structures.
Nested Unordered Lists
- Fruits
- Apple
- Red apple
- Green apple
- Banana
- Orange
- Apple
- Vegetables
- Carrot
- Chinese cabbage
Nested Ordered Lists
- Preparation
- Collect materials
- Make a plan
- Implementation
- Start execution
- Monitor progress
- Summary
Mixed Nesting
- Main tasks
- Subtask A
- Subtask B
- Step 1
- Step 2
- Subtask C
- Minor tasks
Add 2 or 4 spaces before sub-list items to realize mixed nesting:
- First item:
- First nested element
- Second nested element
- Second item:
- First nested element
- Second nested element
Nesting Rules
- Indent sub-lists with 2 to 4 spaces (2 spaces recommended)
- Keep the indentation consistent
- Nesting can be unlimited, but it is recommended to use no more than 3 levels in practice
Task Lists (Checkbox Lists)
Task lists are an extended feature of GitHub Flavored Markdown and are widely supported nowadays.
Basic Syntax
- [ ] Incomplete task
- [x] Completed task
- [ ] Another incomplete task
Practical Example
Project To-do List
Design Phase
- Requirement analysis
- Prototype design
- UI design
Development Phase
- Front-end development
- Page layout
- Interactive functions
- Responsive adaptation
- Back-end development
- Database design
- API development
- Performance optimization
Testing Phase
- Unit testing
- Integration testing
- User acceptance testing
Usage Tips
- The space and letter
xinside the brackets are required:[ ]and[x] - Task lists can be combined with nested lists
- Ideal for project management, study plans and daily checklists
- Checkboxes can be toggled by clicking in some editors
Advanced List Skills
Multiple paragraphs inside a list item
> Blockquotes are also available inside list items
-
First item
This is the detailed description of the first item. Keep the content indented and aligned.
This is another paragraph. -
Second item
Blockquotes are also available inside list items
Line breaks inside a list item
- This is a long list item.
Add indentation to wrap text on a new line. - Another list item.