본문 바로가기
C.W.K.
Stream
Lesson 05 of 08 · published

Alert — > [!NOTE], [!WARNING], 그리고 친구들

~10 min · markdown, gfm, alerts, callouts

Level 0평문
0 XP0/64 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

GitHub 가 색깔 callout 으로 변신시키는 blockquote

GFM alert 는 첫 줄에 [!TYPE] (대문자, 대괄호) 를 적은 blockquote 야. GitHub 렌더러가 그 [!TYPE] 줄은 걷어내고, 남은 인용문에 색깔 바와 아이콘, 라벨 헤더를 입혀줘.

Alert 다섯 종류

  • [!NOTE] — 중립 정보, 파랑.
  • [!TIP] — 도움 되는 제안, 초록.
  • [!IMPORTANT] — 필독, 보라.
  • [!WARNING] — 잠재 footgun, 노랑/주황.
  • [!CAUTION] — 위험한 액션, 빨강.

휴대성

Alert 는 GitHub 전용 확장이야. 다른 렌더러 (pandoc, 순수 CommonMark, GitHub 스타일 플러그인 없는 정적 사이트 생성기) 는 [!NOTE] 를 blockquote 안의 그냥 글자로 취급해. 읽히기는 읽히는데 색깔과 아이콘은 통째로 날아가.

한 블록에 alert 종류 섞지 마. alert 하나에는 종류 하나만 담겨. 같은 주제에 tip 과 warning 이 둘 다 필요하면 alert 를 두 개로 쪼개. 렌더러는 첫 줄만 보고 스타일을 정하거든.

Code

다섯 alert 종류 모두·markdown
> [!NOTE]
> Useful information that helps the reader.

> [!TIP]
> A pro move that saves time.

> [!IMPORTANT]
> Crucial information needed for success.

> [!WARNING]
> Urgent info — avoid problems.

> [!CAUTION]
> Negative consequences if ignored.
포매팅 있는 멀티라인 alert·markdown
> [!IMPORTANT]
> Run the migration **before** deploying.
>
> Steps:
> 1. Apply `0042_user_schema.sql`
> 2. Verify the count: `SELECT COUNT(*) FROM users WHERE email IS NOT NULL`
> 3. Then deploy the new code
휴대 가능한 fallback (어디서나 렌더링)·markdown
> **Warning:** This is the CommonMark-portable equivalent of an alert.
> Use it when you target docs sites that don't render GFM alerts.

External links

Exercise

'Note:' 나 'Warning:' 문단이 있는 최근 README 를 열어. 항목마다 맞는 GFM alert 로 바꿔. feature 브랜치에 push 하고 GitHub 에서 확인해. 그 다음 같은 파일을 로컬 Markdown 미리보기 (VS Code, Obsidian) 에서도 열어서 비교해봐. 그 차이가 바로 GFM 을 쓰는 대가야.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.