Bill Powell Is Alive [The Den]
{ Three Acres and a Penguin }

Markdown Syntax Summary

begun: 2008-03-31 22:16:11 | updated: 2008 Apr 26 00:02 | tags:

An overview of Markdown syntax, refactored from http://daringfireball.net/projects/markdown/syntax#html.

Markdown is a minimal syntax set, designed to make it easy to write and edit your prose. You can use HTML tags whenever you need to.

Markdown syntax cannot be used within block-level HTML.

Span-level HTML tags -- e.g. <span>, <cite>, or <del> -- can be used anywhere in a Markdown paragraph, list item, or header.

Overview

To get: Type:
< <
& &
paragraph break one or more blank lines
br two spaces at end of line
H1 (underlined style) Your header 1
================
H2 (underlined style) Your header 2
----------------
H1 (atx style) #Your header 1
H2 ##Your header 2
Continue down to H6 ######Your header 6
Blockquotes > First level of quote
> > Second level; a quote-within-a-quote
Unordered List * Item 1
+ Item 2
- Item 3
+ Whatever.
Ordered List 1. Item 1
2. Item 2
47. Item 3 still works.
hr *** or +++ or --- or * * * or any combination, on their own line
link (inline) [the link](http://thelink.com "Optional Title")
link (reference) link: [the link][id]
definition: [the link][id] [id]: http://thelink.com "Optional Title"
Multiple forms: see below.
images Same as links (inline or reference), except with ! before text, e.g.:
![Alt text](/path/to/img.jpg)
links (automatic) <http://example.com/>
<email-address@example.com>
em *em* or _em_
strong **strong** or __strong__
code `code` or ``code``

More examples

> This is a blockquote with one paragraph. Each line begins
> with an arrow.

> Another blockquote, but only one arrow at the beginning.
Don't actually need more.

> This is the first level of quoting.
>
> > This is a nested blockquote.
> 
> Back to the first level.

* An unordered list
+ With mismatching bullets
- Still works

1. An ordered list
23. Just needs to begin with 1.

This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.
See my [About](/about/) page for a relative path.

[An example][id] reference-style link.
[An example] [id] reference-style link with a space.
[An example][] reference-style link, with an implied id of "An example".

Reference links require link definitions, which can take several forms:

[id]: http://example.com/  "Optional Title Here"
[id]: http://example.com/  'Optional Title Here'
[id]: http://example.com/  (Optional Title Here)
[id]: <http://example.com/>  "Optional Title Here"
[id]: http://example.com/longish/path/to/resource/here
    "Optional Title Here"

Reference links are case-insensitive.

Image links:

![Alt text, inline](/path/to/img.jpg)
![Alt text, inline](/path/to/img.jpg "Optional title")

![Alt text, reference-style][id]
[id]: url/to/image  "Optional title attribute"

Additional notes

Lists

Separate list items with blank lines if you want each item to be enclosed in a <p> tag.

List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab.

To avoid an accidental list by a number at the start of a line, you can backslash-escape the period:

1986\. What a great season.

Blockquotes

A Markdown "indent" is 4 spaces or one tab.

To put a blockquote within a list item, the blockquote's > delimiters need to be indented.

Code blocks

To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab.

To put a code block within a list item, the code block needs to be indented twice -- 8 spaces or two tabs.

Special characters

Use a backslash to escape:

    \   backslash
    `   backtick
    *   asterisk
    _   underscore
    {}  curly braces
    []  square brackets
    ()  parentheses
    #   hash mark
    +   plus sign
    -   minus sign (hyphen)
    .   dot
    !   exclamation mark

You'll also want to read the original, full Markdown syntax here.

On this site, I'm actually using pymarkdown, a pyblosxom plugin.

Here's another python implementation of Markdown. This is exciting because you can use extensions.

You can convert Markdown to formats besides HTML with other programs. Like Pandoc.

Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses this library. It can read markdown and (subsets of) reStructuredText, HTML, and LaTeX, and it can write markdown, reStructuredText, HTML, LaTeX, ConTeXt, RTF, DocBook XML, groff man, and S5 HTML slide shows.

I haven't tried Pandoc yet, but since I went to the trouble to install Haskell to get it working, I thought I'd mention it. :)

« Resumé  •  Welcome to the Den »

Now available as bpalv.com!
Stop typing that amusing but neverending old
billpowellisalive-with-lots-of-tiny-l's-and-i's.com,
and try bpalv.com today!

Frequently Aggravating Questions

Helpful Pages

Feed: RSS 2.0 | Atom

Search

Tags/Categories/Ideas/Glue

(A supposedly easy and delightful way to navigate this site. Click one. It'll make sense soon.)

Archives

< April 2008 >
SuMoTuWeThFrSa
   1 2 3 4 5
6 7 8 9101112
13141516171819
20212223242526
27282930   
2008 2007 2006 2005 2004 2003 2001 2000 1999 1998 1997 1996

Rules

Do not link to dates or tags. They are capricious. They fear commitment.

Do not assume everything is tagged.

Do not boss around visitors to your web site.


[Powered by PyBloxsom]