HTML

Getting to Know Markdown

HTMLThe Web has become enmeshed in all aspects of our lives. And whether we realize it or not, so has HTML, the language that’s used to format Web pages. Even people who aren’t web designers or coders — bloggers, writers, even folks who want to create content for personal web pages — need to know some HTML.

Or do they?

While basic HTML is fairly easy to learn, there are a lot of people who use that skill only occasionally. And, anyway, knowing even a bit of HTML is overkill for most purposes. So, what’s the alternative? Why not take a shortcut and use Markdown instead?

Markdown: The Basics

Markdown is a simple language for formatting text that was created by John Gruber and Aaron Swartz. The goal was to create something that is easy to use and remember, and which can be quickly converted to HTML.

Specify all formatting using keyboard symbols, rather than tags surrounded by angle brackets (as you would in HTML). The formatting you can use is quite basic — mainly headings, lists, links, quotes, as well as bold and italic text — but it’s more than enough for most purposes.

To format something as a heading, for example, put anywhere from one to six hash signs (#) in front of the text. Format the title of your document like this:

[code lang=”plain”]
# My Title
[/code]

For a bullet list, put an asterisk (*) followed by a space in front of each item in the list:

[code lang=”plain”]
* List item
* Another list item
* Last list item
[/code]

Markdown example

If you’re interested in learning Markdown’s syntax, check out this reference.

Remember that Markdown is a plain text format. You create files in a text editor like Emacs, Vim, BBEdit, Gedit, or even Notepad. That makes whatever you’re writing very portable and timeless. Plain text never goes out of style.

Converting Markdown to HTML

There are a number of tools for doing this. If you’re not afraid of the command line and have Perl installed on your computer, you can use the conversion script found here. Or you can download and compile Discount.

In either case, to convert a document formatted with Markdown to HTML, open a terminal or command line window, navigate to the directory containing the document you want to convert and then type the following command:

[code lang=”shell”]
markdown myfile.text > myfile.html
[/code]

Here are the results of a conversion:

Converted file
Markdown text converted to HTML

 

Or, if you prefer, you can use an online converter like this one. Just copy and paste your Markdown-formatted document from a text editor into the converter, click a button, and you get HTML almost instantly.

Markdown on the Web

There are a number of other converters available, too. You can find a list of them here.

Final thoughts

Markdown is a great solution for anyone who needs to quickly generate web-ready files. The formatting is easy to learn, and it’s efficient — you use keyboard symbols, which anyone can type. If your web publishing needs are simple, then Markdown is a great option.

Photo credit: Tysto


Posted

in

,

by

Tags:

Comments

3 responses to “Getting to Know Markdown”

  1. […] I work on drafts in the same way that I create notes. And I use many of the same tools — either saving files directly into a folder in DropBox called WiP (Work in Progress) or using TextDrop and formatting the documents using Markdown. […]

  2. […] Writing on the Web simply, with typerighter.com  March 12, 2012 by Scott Nesbitt If there’s one thing I appreciate, it’s simplicity. Especially in my software. I’ll let you in on a little secret: for a good chunk of the writing I do, a word processor is overkill. I can get be more than comfortably with a text editor and Markdown. […]

  3. […] — like HTML or Markdown — to other formats. For example, I write much of my work using Markdown. Using Pandoc I can, for example, to take a blog post and convert it to HTML or PDF or Open […]

Leave a Reply