Markdown Syntax Cheat Sheet =========================== URL: http://hw.libsyn.com/p/8/3/3/8339a864bb8faa83/Markdown_Cheat_Sheet.pdf Markdown Syntax Cheat Sheet --------------------------- based on Markdown Syntax documentation for Markdown 1.0.1, created by John Gruber for full syntax, visit http://daringfireball.net/projects/markdown/syntax Markdown Syntax Cheat Sheet v1.0, design by Mark Boszko Text cleanup version by Mark Stinson --- Paragraphs and Breaks --------------------- Markdown accepts text on consecutive lines as a hard-wrapped paragraph. Put a blank Line in between to start a new graph. If you want a break: end your line with two spaces. Hard to see in print, but it’s there. --- Headers ------- h1 and h2 ›Setext-style == -- ›any number of underlines works # h1 ›atx-style ## h2 ›opening hashes determine header level ... ###### h6 ## ›closing hash(es) optional --- Blockquotes ----------- > Blockquote. > > > Second paragraph in the blockquote, nested. > > ## This is an h2 in a blockquote --- Phrase Emphasis --------------- *em* or _em_ or un*fucking*believable **strong** or __strong__ ***em and strong*** or ___em and strong___ --- Lists ----- * Candy. or + Candy. or - Candy. * Gum. + Gum. - Gum. * Booze. + Booze. - Booze. 1. Ordered ›start the list with number 1 2. List ›otherwise number order doesn’t matter 3. Items * A list item. With multiple paragraphs. > And a blockquote * Another List item with a hard wrapped 2nd line. 10 PRINT "and a code block" --- Horizontal Rules ---------------- --- or *** or ___ ›on a line by itself --- Links ----- An [inline link](http://xrl.us/ "optional title"). A [reference link][id]. ›[id] defined elsewhere [id]: http://example.com/ "optional title" or [id]: <http://example.com/> (optional title) or [id]: http://example.com/longish/path/to/resource "optional title" [Google][] ›implicit link name shortcut [Google]: http://google.com <http://example.com/> ›creates linked URL <address@example.com> ›creates encoded mailto --- Images ------ ![Alt text](/path/to/img.jpg "Optional title") ![Alt text][id] ›refrence-style [id]: url/to/image "Optional title attribute" --- Code ---- Backticks format and auto-escape &, < and > in code like `<blink>`, `—` and `—`. Preformatted code is also easy.™ <strong>Just indent 4 spaces.</strong> Double-backticks delimit literal backticks: ``There’s a backtick (`) here.`` and here: `` ` `` A backtick-delimited string: `` `foo` `` --- Escaping -------- Backslash (\) escapes the following characters: ! . - + # ( ) [ ] { } _ * ` \ \*this text is surrounded by literal asterisks\* Avoid accidental numbered lists by escaping: 1918\. What a great season. --- Markdown Appendix ----------------- based on Markdown Syntax documentation for Markdown 1.0.1, created by John Gruber http://daringfireball.net/projects/markdown/syntax --- HTML Tag Integration -------------------- For any <span id="true"> markup that is *not* covered by Markdown’s syntax</span>, use HTML tags. Block-level HTML elements (div, table, pre, p, etc.) must be surrounded by blank lines, as so: <table> ›don’t indent the block’s start line <tr> <td>Foo</td> </tr> </table> ›or the end line Markdown formatting syntax is not processed within block-level HTML tags. --- Blockquote Addendum -------------------- > Blockquotes can have several-sentence paragraphs > that are hard-wrapped with angle brackets. > > These look pretty, but require effort. > You can instead be lazy and omit the angle bracket at the beginning of successive lines. > And only pick it up again at the beginning of the next paragraph. --- List Addendum ------------- * List markers typically start at the left margin, but may be indented by up to 3 spaces. * List markers must be followed by one or more spaces or a tab. * To make lists look nice, you can wrap items with hanging indents (as above). * But if you want to be lazy, you don’t have to. * List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be intended by either 4 spaces or one tab. You can also be lazy here, and just indent the first line of the paragraph. --- Code Addendum ------------- Regular Markdown syntax is not processed within code blocks. --- PHP Markdown Extra ------------------ based on Markdown moditications as found in PHP Markdown Extra 1.1.7, by Michel Fortin http://michelf.com/projects/php-markdown/extra/ --- Inline HTML ----------- <p>Blocks can now be indented up to 3 spaces and not accidentally become a code block</p> --- Markdown inside Blocks ---------------------- <div markdown="1"> Apply the markdown attribute to the block to enable *Markdown* formatting syntax. </div> <table> <tr> <td markdown="1">*Span* level Markdown.</td> <td markdown="block">*Block* level Markdown.</td> </tr> </table> --- Header ID Attribute and Links ----------------------------- ## Header One {#header1} [Link back to Header One](#header1) --- Tables ------ Item | Value ›headers --------- | -----: ›colon marks column alignment Computer | $1600 ›use both colons for centered Phone | $12 ›colons are optional Pipe | $1 ›only one pipe/line is req'd --- Definition Lists ---------------- Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. : An American computer company. --- Footnotes --------- This is text with a footnote.[^1] [^1]: And this is the footnote. --- Abbreviations ------------- The HTML specification is maintained by the W3C. *[HTML]: Hyper Text Markup Language --- Escaping -------- Avoid triggering a definition list or table with backslash escaping : or |, as in \: and \|