Markdown Primer

2016-10-23  本文已影响0人  酒桶九筒

References:

  1. Markdown: Syntax
  2. 献给写作者的 Markdown 新手指南

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>


<h3 id="headers">HEADERS</h3>
Markdown supports two styles of headers, Setext and atx.

tips:Any number of underlining =’s or -’s will work.

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

  1. It looks best if you hard wrap the text and put a > before every line
  2. Markdown allows you to be lazy and only put the > before the first line of a hard-wrapped paragraph
  3. Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of >
  4. Blockquotes can contain other Markdown elements, including headers, lists, and code blocks

<h3 id="lists">LISTS</h3>

Unordered List

Syntax:Unordered lists use asterisks(*), pluses(+), and hyphens(-)

Examples

Ordered List

Syntax:Ordered lists use numbers followed by periods(2016.)

Examples

  1. Marry
  2. John

Tips

  1. It’s important to note that the actual numbers you use to mark the list have no effect on the HTML output Markdown produces.
  2. If list items are separated by blank lines, Markdown will wrap the items in <p> tags in the HTML output.
  3. 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
  4. To put a blockquote within a list item, the blockquote’s >
    delimiters need to be indented by either 4 spaces or one tab
  5. To put a code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs
  6. 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.

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.

上一篇 下一篇

猜你喜欢

热点阅读