Introducing Markdown for Content and Comments

by Brent Shaffer on 1/24/12

Have you ever pasted application code into a forum thread and saved it, only to see your comment broken and garbled when you refresh the page? This may have happened to you, and as developers it is imperative that our code samples are properly formatted.

Markdown is a lightweight markup language that corrects this frustration. It is easy to read and easy to write, ensuring your content is formatted properly. For those not familiar, spend some time going over the official Markdown Syntax Guide at Daring Fireball. If you are the Learn-By-Doing type, check out the Web Dingus. As an example, we will demonstrate the main syntactical elements used by most developers, which are bold, italics, links, lists, and code blocks.

I _really_ like that [Developer Connection]( supports `Markdown`.  I can now post rich code like this!

    $response = $api->sendRequest('Company.GetReportSuites', $params);
    return $response['report_suites'];

Thanks, **guys**, for making this possible.  On the whole, I'd say you all are:

* Benevolent
* Tenacious
* Splendid

This will output the following response:

I really like that Developer Connection supports Markdown. I can now post rich code like this!

$response = $api->sendRequest('Company.GetReportSuites', $params);
return $response['report_suites'];

Thanks, guys, for making this possible. On the whole, I'd say you all are:

  • Benevolent
  • Tenacious
  • Splendid

There is a convenient reference to the syntax guide everywhere Markdown is used. Look for the link in the upper right corner of the text area.

Syntax Guide Link

Clicking on it will provide you with a fancybox containing the syntax guide.

Syntax Guide Fancy Box

For those familiar with Github-Flavored Markdown (GFM), there are some key differences. The most important one being newline breaks are not parsed as <br /> tags. Add two or more spaces at the end of a line to insert a line break.

Thank you for contributing to Developer Connection! We hope to make your ongoing participation as enjoyable as possible. Also, we would love to hear from you. Please comment below (using Markdown!) with your thoughts on the change.

This blog post has been written in Markdown. View the source.

Great post. (See, I used Markdown). It's particularly handy for code help sites like this one.

One question, though. What are your thoughts on the proprietary formatting that sites like Wikipedia or even coder-friendly sites like Stack Overflow use? Surely they were aware of standards like Markdown when building them. I've even wondered why some sites go with BBCode. There doesn't seem to be much consensus or comprehensive usability testing to rely on.

Thanks for your feedback! Stack Overflow uses Markdown, Wikipedia uses Wiki Markup, which is similar. Although Markdown is popular, there is not yet a consensus on the format used. BBCode, RTF, Textile, and Dotclear are among the other frontrunners. But there does seem to be agreement that lightweight markup languages are safer and more reliable than HTML for user input. It is hard to mess up, easy to parse, and supports only allowed elements.

Must be logged in to comment. or register now to comment!