What is Markdown?


Markdown and it's output

Up until early January I had never even considered researching, learning or using markdown. I figured if I can write html, I had no need to learn markdown. My opinion was changed after exploring my options for syntax highlighting on this blog.

I had some basic needs for yourshoesuntied.com and spent a lot of time researching the best tools for the job. To blog about code and web design, I needed the following things:

• The blog needed to be fast to update and easy to manage. No one has time for overly complicated plugins. The more efficiently I can write, the better.
• I needed to be able to publish highlighted code snippets in multiple languages. Those of you who have tried this know it can be frustrating and complex.
• The over all appearance needs to be attractive and easy to read.

After digging in and researching, I settled on using markdown for this blog. Since yourshoesuntied.com is powered by WordPress, I needed two new plugins, Markdown On Save Improved and Wp-Highlight.js. So far, these two plugins seem to work together fairly harmoniously and require little effort to implement and learn. Before we get too bogged down in the details let’s show off the capabilities a bit.
 
 

Markdown Demo


This is a markdown H3 level heading

Here is some bold text

Here is some emphasized text

Inline-style link to google

Now lets try a code block…

$('#some-id').css({
    height:'10px',
    width : '20px',
    fontSize: '2em'
});  

or how about some html…

<!DOCTYPE HTML>
<html>
    <head>
        <script>
            //add some javascript here
        </script>
    </head>
    <body>
        <p>Writing with markdown is fast, and effective</p>
    </body>
</html>

or some php maybe…

<?php echo"Highlight.js automatically detects and styles the language"; ?>

<?php 
    $string = "All you have to do is select a code theme in the settings";
    echo $string;
>

As you can see this works quite well and satisfies the basic needs I had for my blog environment. So let’s get back to the original question.
 
 

So what exactly is Markdown?


First and foremost, markdown is a way of writing plain text that requires no proprietary encoding or special software. If you want to get more in depth about its history and implementation checkout Wikipedia, but for all intents and purposes, it is just a style of writing plain text. If you learn the basic rules, and stick to them, you can generate html-type markup without writing any html. For instance:

If I was using a markdown plugin for the wordpress posts editor (it just so happens I am right now), I could create a large heading by simply typing the following:

#This is a large heading!#

To hand code that in html you would have to do this:

<h1>This is a large heading</h1>

Though this may not seem like a huge difference, a few characters here and there really adds up as you style a whole document. It can be especially tricky if you are inexperienced with html. Minor html errors can cause major problems and unexpected results. Markdown is a nice, easy to debug format.
 
 

Where can I use Markdown?


Markdown has become particularly popular among the coder community. For instance, the README.md files on many github repositories are written in markdown. This allows users to style their documentation, include code snippets and present their projects in as rich a format as possible.
 
 
github README.md screen capture

According to Wikipedia, the following are some notable sites that have adopted markdown.

GitHub
reddit
Diaspora
Stack Overflow
OpenStreetMap
SourceForge
 
 

Where can I learn Markdown?

A simple google search will get you a lot of info on markdown and markdown syntax, but I found the following resources useful.

Basic Markdown Cheatsheet
This is a nice straight forward guide to basic Markdown written by the yourshoesuntied.com team.

Daring Fireball
This project has lots of great info on markdown, as well as syntax guide.

Github: Markdown Cheatsheet
Here you can find a very cut and dry list of markdown syntax.

Markdown Here: Live Demo
This page is a great learning tool. You can write and edit Markdown and see your results right in the browser.

Sources


1. Wikipedia: http://en.wikipedia.org/wiki/Markdown
2. Daring Fireball: http://daringfireball.net/projects/markdown/syntax
3. Wikipedia: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
4. Markdown Live Editor: http://jrmoran.com/playground/markdown-live-editor/


Join the discussion

Email addresses will not be published.
Comments will not be displayed until approved by an admin