References:
HTML is a publishing format; Markdown is a writing format.
PARAGRAPHS AND LINE BREAKS
HEADERS
BLOCKQUOTES
LISTS
CODE BLOCKS
HORIZONTAL RULES
LINKS
EMPHASIS
IMAGES
CODE
AUTOMATIC LINKS
BACKSLASH ESCAPES
<h3 id="paragraph">PARAGRAPHS AND LINE BREAKS</h3>
- A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines. Normal paragraphs should not be indented with spaces or tabs. The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs.
- When you do want to insert a
<br />
break tag using Markdown, you end a line with two or more spaces, then type return.
<h3 id="headers">HEADERS</h3>
Markdown supports two styles of headers, Setext and atx.
-
Setext
This is an H1
=============This is an H2 -------------
tips:Any number of underlining =’s or -’s will work.
- atx
# This is an H1
## This is an H2
###### This is an H6
Examples
This is an H1
This is an H2
This is an H6
<h3 id="blockquotes">BLOCKQUOTES</h3>
Syntax:> to be referenced...
Examples
to be referenced...
Tips
- It looks best if you hard wrap the text and put a > before every line
- Markdown allows you to be lazy and only put the > before the first line of a hard-wrapped paragraph
- Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of >
- Blockquotes can contain other Markdown elements, including headers, lists, and code blocks
<h3 id="lists">LISTS</h3>
- ordered list
- unordered list
Unordered List
Syntax:Unordered lists use asterisks(*), pluses(+), and hyphens(-)
Examples
- John
- Marry
Ordered List
Syntax:Ordered lists use numbers followed by periods(2016.)
Examples
- Marry
- John
Tips
- It’s important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces.
- If list items are separated by blank lines, Markdown will wrap the items in
<p>
tags in the HTML output. - List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab, Markdown will allow you to be lazy again
- To put a blockquote within a list item, the blockquote’s >
delimiters need to be indented by either 4 spaces or one tab - To put a code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs
- a number-period-space sequence at the beginning of a line. To avoid this, you can backslash-escape(\) the period
<h3 id="codeblocks">CODE BLOCKS</h3>
**Syntax: **To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab.
Examples
int main()
{
return 0;
}
<h3 id="horizontalrules">HORIZONTAL RULES</h3>
**Syntax: *You can produce a horizontal rule tag (<hr />) by placing three or more hyphens(-), asterisks(), or underscores(_) on a line by themselves.
Examples
</br>
<h3 id="links">LINKS</h3>
**Syntax: **Markdown supports two style of links: inline and reference.
- inline:
an example - reference:
This is [an example] [id] reference-style link.
[id]: http://example.com/ "Optional Title Here"`
Examples
This is an example inline link.
This link has no title attribute.
Tips
The implicit link name shortcut allows you to omit the name of the
link, in which case the link text itself is used as the name.
Just use an empty set of square brackets -- e.g., to link the word
"Google" to the google.com web site, you could simply write:
[Google][]
And then define the link:
[Google]: http://google.com/
<h3 id="emphasis">EMPHASIS</h3>
**Syntax: **Markdown treats asterisks(*) and underscores(_) as indicators of emphasis. **bold: ****text**; *slant: **text*
Examples
BOLD
SLANT
<h3 id="code">CODE</h3>
**Syntax: **To indicate a span of code, wrap it with backtick quotes(`)
Examples
Use the printf()
function.
Tips
To include a literal backtick character within a code span, you can use multiple backticks as the opening and closing delimiters
``There is a literal backtick (`) here.``
<h3 id="images">IMAGES</h3>
**Syntax: **Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference.
-
inline:
`
- reference:
![Alt text][id]
related: [id]: url/to/image "Optional title attribute"
Examples
Tips
As of this writing, Markdown has no syntax for specifying the dimensions of an image; if this is important to you, you can simply use regular HTML<img>
tags.
<h3 id="automaticlinks">AUTOMATIC LINKS</h3>
Markdown supports a shortcut style for creating “automatic” links for URLs and email addresses: simply surround the URL or email address with angle brackets.
**Syntax: **
<http://example.com/>
<address@example.com>
Examples
//www.greatytc.com
goodcomrade@hotmail.com
<h3 id="backslash">BACKSLASH ESCAPES</h3>
Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown’s formatting syntax.
**Syntax: ** \x(x is any character below.)
\ backslash
` backtick
* asterisk
_ underscore
{} curly braces
[] square brackets
() parentheses
# hash mark
+ plus sign
- minus sign (hyphen)
. dot
! exclamation mark
create time: 2016-10-23