Code Metaphor

Programming, Writing, Reading, Thoughts…

Markdown Extra 디자인에 잠깐 감탄

Markdown ExtraPHP Markdown를 작성한 Michel FortinMarkdown에 없는 테이블, 헤딩 ID, 정의 목록 등을 추가한 확장 스펙으로, 요즘에는 Pandoc 등 다른 구현에서도 많이 구현해서 거의 de facto standard로 받아들여지는 분위기다. 나도 이 확장 스펙을 거의 당연시하며 사용하고 있는데, 오늘 이 스펙의 정의 목록이 생각보다 잘 디자인되어 있다는 것을 깨달았다.

이 문법은 대충 다음과 같은데,

Apple
:   Pomaceous fruit of plants of the genus Malus in the family Rosaceae.

Orange
:   The fruit of an evergreen tree of the genus Citrus.

저걸 HTML로 바꾸면 아래와 같이 렌더링된다.

Apple
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
Orange
The fruit of an evergreen tree of the genus Citrus.

그런데 이게 표준 Markdown 스펙으로 해석을 하게 되면, <dt> 부분의 줄과 :으로 시작하는 <dd> 부분의 줄 사이에 공백이 없기 때문에 하나의 문단(<p>)으로 처리되게 된다. 그래서 제대로 된 정의 목록으로 보이지는 않지만, 그럭저럭 한 문단 안에 콜론이 들어있는, 사람이 보기에는 정의 목록과 비슷하게 보이는 HTML로 렌더링된다.

Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae.

Orange : The fruit of an evergreen tree of the genus Citrus.

이 문법은 나름대로 하위호환성을 고려하고 디자인되었던 것이다.

덧. 어쩐지 이 블로그는 Markdown을 전문적으로 취급하는 블로그가 되어가는 느낌이 든다.

This entry was posted on November 12, 2009 at 10:46 AM. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

3 Responses to “Markdown Extra 디자인에 잠깐 감탄”

  1. khris Says:

    바로 달려가서 제 텀블러에 적용해보니 대시보드 에서는 작동하지 않고 실제 블로그에서는 훌륭하게 먹히는군요. 뭐 이런;

  2. 엽우 Says:

    전 Markdown을 볼 때마도 문법으로 지원하는 위키가 있으면 좋겠다는 생각을 하곤 하죠. 민희님께서 하나 만드심이… _ _);

  3. dahlia's me2DAY Says:

    민희홍의 생각…

    Markdown Extra 디자인에 잠깐 감탄…

Powered by WordPress. Styled by Hong, MinHee. XML Feed, Comments XML Feed.