Markdown 102: list, quote และ codeMarkdown 102: lists, quotes, and code
เขียน bullet, list แบบมีเลข, checklist, blockquote, inline code และ code block พร้อมรู้ข้อผิดพลาดที่ทำให้ Markdown render เพี้ยนWrite bullets, numbered lists, checklists, blockquotes, inline code, and code blocks while avoiding the mistakes that make Markdown render strangely.
The fastest way to make a README readable is to stop writing one giant paragraph.
Lists, quotes, and code blocks give the reader scanning handles. They can jump to the command, checklist, warning, or decision without reading every sentence.
Bullets
Use - for normal bullets.
## Features
- Live Markdown preview
- Copy button
- GitHub-style tables
Keep each bullet parallel. If the first bullet starts with a verb, make the others start with verbs too.
Good:
- Install dependencies
- Run the dev server
- Open the preview
Messy:
- Install dependencies
- The dev server
- Preview should be opened
Numbered lists
Use numbers when order matters.
1. Clone the repository
2. Install dependencies
3. Start the dev server
Most Markdown renderers will fix the displayed numbers for you, but beginners should write the real numbers anyway. It keeps the source easier to read.
Checklists
GitHub-flavored Markdown supports task lists:
- [x] Create the project
- [x] Add a README
- [ ] Add screenshots
- [ ] Publish the first release
Use checklists for work status, launch steps, migration steps, and "before you submit" items.
Blockquotes
Use > when you want a note to stand apart.
> This project is a prototype. Do not use it for production data yet.
A quote should be short. If it becomes three paragraphs long, it is probably a section, not a quote.
Inline code
Use backticks for command names, filenames, package names, and exact values.
Run `pnpm install`, then open `README.md`.
Do not put every technical word in backticks. Reserve them for exact text the reader may need to type, copy, or recognize.
Code blocks
Use fenced code blocks for commands or code snippets.
```bash
pnpm install
pnpm run dev
```
Add the language name when you know it. GitHub can use it for syntax highlighting.
Common language labels:
| Use this | For |
|---|---|
bash | Terminal commands |
ts | TypeScript |
tsx | React components |
json | JSON config |
md | Markdown examples |
Common beginner mistakes
Forgetting the blank line before a list.
This often renders badly:
Install the tool:
- Step one
- Step two
This is safer:
Install the tool:
- Step one
- Step two
Using tabs for nested lists.
Use two spaces for a simple nested list:
- Setup
- Install Node
- Install pnpm
Mixing a checklist marker with normal text.
This is a checkbox:
- [ ] Write docs
This is just text:
- [] Write docs
That missing space matters.
Checkpoint
Turn this rough note into Markdown:
Setup
install node
install pnpm
run pnpm install
warning this uses local environment variables
A clean answer:
## Setup
- Install Node
- Install pnpm
- Run `pnpm install`
> Warning: this uses local environment variables.
วิธีที่เร็วที่สุดในการทำให้ README อ่านง่ายขึ้น คือเลิกเขียนเป็นย่อหน้ายาวก้อนเดียว
list, quote และ code block ช่วยให้คนอ่านกวาดตาได้เร็วขึ้น เขาจะเห็น command, checklist, warning หรือ decision โดยไม่ต้องอ่านทุกประโยคตั้งแต่ต้น
Bullet
ใช้ - สำหรับ bullet ทั่วไป
## Features
- Live Markdown preview
- Copy button
- GitHub-style tables
พยายามเขียน bullet ให้ขนานกัน ถ้า bullet แรกขึ้นต้นด้วย verb bullet อื่นก็ควรขึ้นต้นด้วย verb เหมือนกัน
ดี:
- Install dependencies
- Run the dev server
- Open the preview
อ่านสะดุด:
- Install dependencies
- The dev server
- Preview should be opened
List แบบมีเลข
ใช้เลขเมื่อ "ลำดับ" สำคัญ
1. Clone the repository
2. Install dependencies
3. Start the dev server
หลาย Markdown renderer จะแก้เลขที่แสดงผลให้เอง แต่สำหรับมือใหม่ ผมแนะนำให้เขียนเลขจริงให้ถูกไว้ก่อน เพราะ source จะอ่านง่ายกว่า
Checklist
GitHub-flavored Markdown รองรับ task list:
- [x] Create the project
- [x] Add a README
- [ ] Add screenshots
- [ ] Publish the first release
ใช้ checklist กับสถานะงาน ขั้นตอนก่อน launch ขั้นตอน migration หรือรายการ "ต้องเช็กก่อนส่ง"
Blockquote
ใช้ > เมื่ออยากให้ note แยกออกมาจากเนื้อหาปกติ
> This project is a prototype. Do not use it for production data yet.
quote ควรสั้น ถ้ายาวสามย่อหน้า มันน่าจะเป็น section มากกว่า quote
Inline code
ใช้ backtick กับชื่อ command, ชื่อไฟล์, ชื่อ package และค่าที่ต้องพิมพ์ให้ตรง
Run `pnpm install`, then open `README.md`.
ไม่จำเป็นต้องใส่ backtick ให้คำ technical ทุกคำ เก็บไว้ใช้กับข้อความ exact ที่คนอ่านอาจต้องพิมพ์ คัดลอก หรือจำให้ตรง
Code block
ใช้ fenced code block สำหรับ command หรือ code snippet
```bash
pnpm install
pnpm run dev
```
ใส่ชื่อภาษาเมื่อรู้ว่าเป็นภาษาอะไร GitHub จะเอาไปใช้ทำ syntax highlighting ได้
ชื่อภาษาที่เจอบ่อย:
| ใช้คำนี้ | สำหรับ |
|---|---|
bash | คำสั่ง terminal |
ts | TypeScript |
tsx | React component |
json | config แบบ JSON |
md | ตัวอย่าง Markdown |
ข้อผิดพลาดที่มือใหม่เจอบ่อย
ลืมเว้นบรรทัดก่อน list
แบบนี้มัก render เพี้ยน:
Install the tool:
- Step one
- Step two
แบบนี้ปลอดภัยกว่า:
Install the tool:
- Step one
- Step two
ใช้ tab กับ nested list
สำหรับ nested list ง่ายๆ ใช้ space สองตัวพอ:
- Setup
- Install Node
- Install pnpm
เขียน checklist marker ผิด
นี่คือ checkbox:
- [ ] Write docs
นี่เป็นแค่ข้อความ:
- [] Write docs
space ที่หายไปมีผลครับ
จุดเช็ก
ลองเปลี่ยน note ดิบนี้เป็น Markdown:
Setup
install node
install pnpm
run pnpm install
warning this uses local environment variables
คำตอบที่สะอาด:
## Setup
- Install Node
- Install pnpm
- Run `pnpm install`
> Warning: this uses local environment variables.
เข้าสู่ระบบเพื่อบันทึกความคืบหน้าSign in to track your progress
เข้าสู่ระบบSign in→