Markdown
March 29, 2009
Markdown is a lightweight markup language, originally created by
John Gruber, which aims for maximum readability and
“publishability” of both its input and output forms, taking many cues
from existing conventions for marking up plain text in email.
Markdown converts its marked-up text input to valid, well-formed XHTML
and replaces left-pointing angle brackets (<
) and ampersands with
their corresponding character entity references. Markdown was
originally implemented in Perl by Gruber, but has since been
re-implemented by others in a variety of programming languages (see
below for list). It is distributed under a BSD-style license and is
included with, or available as a plugin for, several content
management systems.
Contents
Syntax examples
This is not an exhaustive listing of Markdown’s syntax, and in many
cases multiple styles of syntax are available to accomplish a
particular effect. See the
full Markdown syntax
for more information. Characters which are ordinarily
interpreted by Markdown as formatting commands will instead be
interpreted literally if preceded by a backslash; for example, the
sequence \*
would output an asterisk rather than beginning a span of
emphasized text. Markdown also does not transform any text within a
“raw” block-level XHTML element; thus it is possible to include
sections of XHTML within a Markdown source document by wrapping them
in block-level XHTML tags.
Paragraphs:
A paragraph is one or more consecutive lines of text separated by one or more blank lines. Normal paragraphs should not be indented with spaces or tabs:
This is a paragraph. It has two sentences.
This is another paragraph. It also has two sentences.
Emphasized text:
*emphasis* (e.g., italics)
**strong emphasis** (e.g., boldface)
Code:
`code`
Lists:
- An item in a bulleted (unordered) list
- Another item in a bulleted list
1. An item in an enumerated (ordered) list
2. Another item in an enumerated list
Headings:
HTML headings are produced by placing a number of hashes before the header text corresponding to the level of heading desired (HTML offers six levels of headings), like so:
# First-level heading
#### Fourth-level heading
The first two heading levels also have an alternate syntax:
First-level heading
===================
Second-level heading
--------------------
Blockquotes:
> This text will be enclosed in an HTML blockquote element.
Links:
[link text here](link.address.here "link title here")
Images:
![Alt text here](Image URL here "Image title here")
Horizontal rules are created by placing three or more hyphens, asterisks, or underscores on a line by themselves. You may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule:
* * *
***
*****
- - -
---------------------------------------
External Links
- Official Markdown website
- Markdown Syntax (also available in German)
- Mailing list (Gmane gateway)
- Wikipedia article
- Markdown wiki at infogami (defunct)
Syntax Guides
- Markdown: Dingus online converter
- Write better Markdown - A style guide by Brett Terpstra
- Markdown cheat sheet
- Quick Markdown Syntax Guide
- Simple Markdown Syntax Reference plain text/html toggle
- Markdown Cheat Sheets - Collection of Markdown cheat sheets on DevCheatSheet.com
Implementations
Bash:
- markdown.bash by Chad Braun-Duin
C:
- Discount by David Parsons
- PEG-markdown by John MacFarlane
- smu implements a simplified markdown dialect
- Sundown
- C++: Cpp-Markdown by Chad Nelson
C#:
- Markdown.NET by Milan Negovan
- MarkdownSharp
- ColdFusion: CFX_Markdown
Common Lisp:
Haskell:
- Pandoc by John MacFarlane (converts Markdown to HTML, LaTeX, ConTeXt, reStructuredText, S5, groff man, DocBook, and RTF, and partially converts HTML, LaTeX, and reStructuredText to Markdown)
- markdown-peg
Javascript:
- Showdown
- js-markdown (deprecated)
Lua:
- markdown.lua by Niklas Frykholm
- lua-discount
- lunamark
newLISP: markdown-newlisp
Perl:
- Markdown by John Gruber
- MultiMarkdown by Fletcher Penney
- Text::Markdown
- PHP: PHP Markdown by Michel Fortin
Python:
- python-markdown by Yuri Takhteyev
- python wrapper around Markdown.pl
- python-markdown2
- Misaka a Python binding for Sundown
Ruby:
- BlueCloth
- Maruku by Andrea Censi
- Tartan by Larry Baltz and David Anderson (generic engine; Markdown and tests implemented as a YAML description)
- RDiscount
- rpeg-markdown
- RedCloth (versions 3.* only)
- kramdown by Thomas Leitner (released December 2009)
- pandoku (Ruby interface for Pandoc)
Scala:
Text Editor Support
BBEdit: has built-in support (syntax highlighting, preview without requiring conversion to HTML) as of version 8.6
- Python method by Jan-Erik Moström
- PHP method by Tim Brayshaw
E
Eclipse: Experimental plugin by Daniel Winterstein
IntelliJ IDEA: idea-markdown by Julien Nicoulaud
ecto
Emacs: markdown-mode by Jason Blevins
gedit: gedit-markdown
MarsEdit
Scrivener from Literature and Latte for Mac OS X
SubEthaEdit
Smultron
TextMate: has built-in support
Texts - a WYSIWYM Markdown editor for Mac and Windows
TextWrangler
Vim: Markdown Vim Mode
WMD - a lightweight Markdown-to-HTML editor
Wiki Support
- atwiki (@wiki)
- diri
- DokuWiki
- DrProject
- Gitit (Haskell)
- IkiWiki (Perl)
- Infogami (Python)
- Informl (Ruby, additional markup for forms and DB queries)
- Instiki (Ruby)
- MoinMoin (plugin)
- Nanoki (Lua)
- Oddmuse (Perl)
- PMwiki (plugin which adds a
(:markdown:)
“tag” to wrap around Markdown, and inside the tag,WikiWords
are non-functional) - Sputnik (Lua)
Blog Software
- Blojsom (with plugin)
- Blosxom (with plugin)
- Dotclear (with plugin)
- Drupal (with plugin)
- Expression Engine (with plugin, proprietary)
- Frog CMS
- Mephisto
- Movable Type (with plugin)
- NanoBlogger (via the Markdown plugin)
- Textpattern (see “Textile replacement” at the PHP Markdown page)
- Tumblr
- Typo
- Weblog
- WordPress (with plugin)
- Web Site Software (Client-side Markdown based blog software to generate professional static web sites from website templates and publish them to the Internet with a click.)
Content Management Systems
- CoalEngine (Native Support)
- Drupal: see Markdown filter, the continuation of Marksmarty module
- Plone - (Native support in Plone 3)
- Squeletml
Converters
The implementations above by default refer to Markdown to XHTML conversion. Converters to and from other formats are also available.
Markdown to LaTeX, Markdown+LaTeX to MathML, etc.
- pandoc (Haskell)
- MultiMarkdown by Fletcher Penney
- TeXdown
- markdown2latex
- kramdown (Ruby)
XHTML to Markdown:
- html2text.py (in Python)
- Markdownify (in PHP)
- Make.text (a bookmarklet which converts any web page into Markdown.)
- XHTML-to-Markdown XSLT (a stylesheet, works with XHTML only)
- Pandoc (a Haskell library that can convert between many formats including Markdown, HTML, reStructuredText, LaTeX, MediaWiki and others)
- kramdown (Ruby)
Other formats to Markdown:
- Pandoc (a Haskell library that can convert between many formats including Markdown, HTML, reStructuredText, LaTeX, and others)
- odt2pandoc (a Python script to convert OpenDocument text files to Markdown)
- word_markdown_macro (a Microsoft Word macro that converts some of Word’s formatting into Markdown)
Other Software
- MarkdownDragAndDrop by Fletcher Penney
- Humane Text Service
- OmniOutlinerMarkdownPlugin by Fletcher Penney
- refbase (web-based literature management app that outputs citations in Markdown format)
- Text to HTML Converter-Markdown (a Windows GUI to converts Markdown text to HTML)
- Markdownr.com (a simple website to preview markdown in real time)
- Pastedown (a pastebin service for Markdown documents)
- Readown (Markdown viewer application for Mac OS X)
- Gouda (an easy-to-use documentation processing script for multi-chapter docs)
- Marked 2 is a Markdown previewer for OS X.
HOWTOs
Tests
- MarkdownTest
- MultiMarkdownTestSuite
- BabelMark Markdown testbed (compare many markdown implementations on the same input)
Discussion
A large number of links were recently removed from the Markdown Wikipedia page, citing the link farm policy. Furthermore, since infogami is defunct, the previous semi-official Markdown wiki hosted there cannot be edited by those without a previously created account. I merged the content of the Wikipedia and infogami pages and created this page in order to provide a publicly-editable repository of Markdown-related links. —Jason Blevins, April 19, 2009 19:19 EDT
This page was moved from the Xbeta Wiki to jblevins.org
for
archiving on July 7, 2015. —Jason Blevins