{{ define "title" }}Markdown Cheatsheet{{ end }} {{ define "content" }}
Markdown syntax can enable you to be more expressive with your text posts on this website, with the ability to write **bold** text, add hyperlinks or embed images onto your profile page, Direct Messages, forum posts and elsewhere - any place on {{PrettyTitle}} that says "Markdown formatting supported."
This is a simple reference sheet for Markdown syntax. Markdown was pioneered by John Gruber and the de facto place to find in-depth documentation is at https://daringfireball.net/projects/markdown/syntax where it was originally described.
Markdown is now a widely supported format across a variety of apps and websites, and there are a few different "flavors" of Markdown with slightly varied behaviors. This website uses GitHub Flavored Markdown, an extension of Markdown that supports fenced code blocks, tables, and other useful features - many of which you can learn about on this page.
A paragraph is defined as a group of lines of text separated from other groups by at least one blank line. A hard return inside a paragraph doesn't get rendered in the output.
There are two methods to declare a header in Markdown: "underline" it by
writing ===
or ---
on the line directly below the
heading (for <h1>
and <h2>
, respectively),
or by prefixing the heading with #
symbols. Usually the latter
option is the easiest, and you can get more levels of headers this way.
Markdown Syntax | Output |
---|---|
This is an H1 ============= This is an H2 ------------- |
This is an H1This is an H2 |
# This is an H1 ## This is an H2 #### This is an H4 |
This is an H1This is an H2This is an H4 |
Prefix a line of text with >
to "quote" it -- like in
"e-mail syntax."
You may have multiple layers of quotes by using multiple >
symbols.
Markdown Syntax | Output |
---|---|
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing. |
|
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
|
|
> This is the first level of quoting.
|
This is the first level of quoting.This is nested blockquote.Back to the first level.A third level. |
> ## This is a header.
|
|
Markdown Syntax | Output |
---|---|
* Red
|
|
+ Red
|
|
- Red
|
|
1. Bird
|
|
1. This is a list item with two paragraphs. Lorem ipsum dolor
|
|
Like GitHub-flavored Markdown, with a fenced code block you can also specify a programming language to get syntax highlighting for the code.
Markdown Syntax | Output |
---|---|
This is a normal paragraph.
|
This is a normal paragraph.
This is a code block |
This is a normal paragraph.
|
This is a normal paragraph.
This is a GitHub style "fenced code block". |
```javascript
|
document.writeln("Hello world."); |
Markdown Syntax | Output |
---|---|
* * *
|
|
Markdown Syntax | Output |
---|---|
This is [an example](http://example.com/ "Title") inline link.
|
This is an example inline link. This link has no title attribute. |
See my [About](/about) page for details.
|
See my About page for details. |
This is [an example][id] reference-style link.
|
This is an example reference-style link. |
This is an example of an implicit reference-style link: search [Google][] for more.
|
This is an example of an implicit reference-style link: search Google for more. |
I get 10 times more traffic from [Google] [1] than from
|
I get 10 times more traffic from Google than from Yahoo or Bing. |
Markdown Syntax | Output |
---|---|
*single asterisks*
|
single asterisks single underscores double asterisks double underscores |
un*frigging*believable
|
unfriggingbelievable |
\*this text is surrounded by literal asterisks\*
|
*this text is surrounded by literal asterisks* |
Markdown Syntax | Output |
---|---|
Use the `printf()` function.
|
Use the printf() function.
|
``There is a literal backtick (`) here.``
|
There is a literal backtick (`) here.
|
A single backtick in a code span: `` ` ``
|
A single backtick in a code span: `
A backtick-delimited string in a code span: |
Please don't use any `<blink>` tags.
|
Please don't use any <blink> tags.
|
`—` is the decimal-encoded equivalent of `—`.
|
— is the decimal-encoded equivalent of
— .
|
Markdown Syntax | Output |
---|---|
![Alt text](/static/avatars/default.png)
|
|
![Alt text](/static/avatars/default.png "Optional title")
|
|
![Alt text][id]
|
Markdown Syntax | Output |
---|---|
<http://example.com/>
|
http://example.com/ |
<address@example.com>
|
address@example.com
(Source: |
\*
to insert a literal asterisk so that it doesn't get mistaken for e.g. emphasized text,
a list item, etc.Markdown provides backslash escapes for the following characters:
\ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parenthesis # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark