Markdown Notes02_Classical Syntax

来源:互联网 发布:淘宝旺旺号 编辑:程序博客网 时间:2024/05/05 15:31

Markdown Notes02_Classical Syntax

Table of Contents

  • Markdown Notes02_Classical Syntax
  • Table of Contents
    • Phrase Emphasis
    • Headers
    • BlockQuotes
    • Lists
    • Code
    • Horizotal Rules
    • Links
    • Image
    • Backslash Escapes

Phrase Emphasis

Markdown treats asterisks * and underscores _ as indicators of emphasis.

  • Bold:

    • Syntax:

      **Markdown Bold**  or  __Markdown Bold__
    • Shortcut: ctrl + B

  • Italic:

    • Syntax:

      *Markdown italic* or _Markdown italic_
    • Shortcut: Ctrl + I

  • Strikethrough:

    • Syntax:

      ~~Markdown strikethrough~~
    • Output:

      Markdown strikethrough

Headers

Markdown supports two styles of headers, Setext and Atx.

  • Setext-style headers:

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

    This is an H1===This is an H2<hr />
  • Atx-style:

    Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6

    # This is an H1## This an H2### This is an H3...###### This is an H6

    or

    # This is an H1 ### This an H2 #### This is an H3 #...###### This is an H6 #

    Reamrk: Add Space before or after #
    Shortcut: Ctrl + H

BlockQuotes

Markdown uses email-style >characters for blockquoting.

> This is blockquote

> ## This is a header.> > 1.   This is the first list item.> 2.   This is the second list item.> > Here's some example code:> >     return shell_exec("echo $input | $markdown_script");

Blockquotes can contain other Markdown elements, including headers, lists, and code blocks.

Shortcut: Ctrl + Q

Lists

Markdown supports ordered (numbered) and unordered (bulleted) lists.

  • Ordered Lists

    Ordered lists use numbers followed by periods:

    1. Bird2. McHale3. Parish

    Shortcut: Ctrl + O

  • Unordered Lists

    Use +/-/*

    * Red* Green* Blue

    is equivalent to :

    + Red+ Green+ Blue

    and:

    - Red- Green- Blue

    Shorcut:Ctrl + U

  • Nest List

    for nest list , input space or tab

    * Color * Red * Green * Blue* Font 1.  Arial 2.  宋体
    • Color
      • Red
      • Green
      • Blude
    • Font
      1. Arial
      2. 宋体

    Remark: align content in next level nest list

Code

  • Code Spans

    • To indicate a span of code, wrap it with backtick quotes (`).

       ` a span of code `
    • Shortcut: Crtl + K

    • Other Style: At least 4 spaces or Tab

  • Code Block

    • Three backtick quotes(`) before and atfter code block

       ```   This is code block  ```
    • Every line of the block by at least 4 spaces or Tab

Horizotal Rules

You can produce a horizontal rule tag by placing three or more hyphens, asterisks, or underscores on a line by themselves.

* * ********- - - ----

Shortcut: Ctrl + R

Markdown supports two style of links: inline and reference.

  • Inline Links:

    • Syntax:

       This is [an example](http://example.com/ "Title") inline link. [This link](http://example.net/) has no title attribute.
    • Shortcut: Ctrl + L

    • Sample:

      [百度](www.baidu.com "百度一下,你就知道" ) 百度

  • Reference Links:

    • Syntax:

      This is [an example][id] reference-style link.[id]: http://example.com/+space+"Optional Title Here"
    • Sample:

      [Stackeidt] [id][id]: stackedit.io/edito+space+"Markdown Editor"
    • 引用链接内容定义的形式为:

      1. Square brackets containing the link identifier (optionally indented from the left margin using up to three spaces);
      2. followed by a colon;
      3. ollowed by one or more spaces (or tabs);
      4. followed by the URL for the link;
      5. optionally followed by a title attribute for the link, enclosed in double or single quotes, or enclosed in parentheses.
    • Other Style:

      The following three link definitions are equivalent:

      [foo]: http://example.com/+space+"Optional Title Here"[foo]: http://example.com/+space+'Optional Title Here'[foo]: http://example.com/+space+(Optional Title Here)

Image

Markdown uses an image syntax that is intended to resemble the syntax for links, allowing for two styles: inline and reference.

  • Inline Image:

    • Syntax:

      ![Alt text](/path/to/img.jpg)![Alt text](/path/to/img.jpg "Optional title")
    • Shortcut:Ctrl + G

    • Sample:

      ![Monchhichi](http://i1.piimg.com/567571/2d67e28eb36f0b21.jpg "soldier")

      Monchhichi

    • Remark:

      链接地址应为图床,否则复制之后图片地址失效,造成无法显示。

      Test ImagePlace : < http://yotuku.cn/#!/>

  • Reference Image:

    • Syntax:

      ![Alt text][id][id]: url/to/image+space+"Optional title attribute"

      That is:

      1. An exclamation mark: !;
      2. followed by a set of square brackets, containing the alt attribute text for the image;
      3. followed by a set of parentheses, containing the URL or path to the image, and an optional title attribute enclosed in double or single quotes.
    • Sample:

      ![ xyz ][ ImageXID ][ ImageXID ] : http://i1.piimg.com/567571/2d67e28eb36f0b21.jpg

       abc

Backslash Escapes

Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown’s formatting syntax.

\*literal asterisks\*

Markdown provides backslash escapes for the following characters:

Characters Name \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark
  • JOHN GRUBER Blog
    http://daringfireball.net/projects/markdown/syntax

Written with StackEdit.

0 0