markdown format for blogging

本文有 2161 字,大约需要 5 分钟可以读完, 创建于 2012-02-26

Markdown format

Blockquotes

Email-style “>” is used for blockquoting, example:

Quoted content More contents follows with another leading >

Lazy blocks New lines can ommit the leading “>” while Markdown is smart enough to be aware of this.

Nested quotes

Nested contents

This is the outer quoted text.

Block quotes can contain other mark down syntax

This is a header

  1. First column
  2. Second column

Here is some example code:

    return shell_exec("echo $input| $markdown_script")

Lists (ordered and unordered)

Both bullet lists and numbered lists are supported.

Colors:

  • Red
  • Green
  • Blue

The same as

  • Red
  • Green
  • Blue

or

  • Red
  • Green
  • Blue

Numbered list

  1. Bird
  2. McHale
  3. Parish

Lists can be intended:

  1. Number 1
  2. Number 2
  3. Number 3

Lists may contain multiple paragraphs

  1. The first paragraph in this list Contents continue

    Another paragraph

  2. Second one, par1

    Par2.

    Qutoes inside the list sub-paragraph


Special blocks

code blocks

Code blocks can be formatted with a new line and an extra 8 spaces or 2 TABs. Exmple:

    #Some shell scripts
    cat log.txt | awk -F":" '{print $2}' | sort -n | wc -l

Span of code like the following function call as sprintf()

This is a line of code contains literal backtick There is a literal backtick (`) here

  1. local link This is an example to refer to a local page, see studyMaterials.

  2. implicit link Links to Google

    Links to official guide, visit Daring Fireball for more information.

  3. link shortcuts

    This is a link to sina. Another link to 163.

Emphasis

  1. Single asterisks example
  2. Single underscore example
  3. Double asterisks double asterisks
  4. Double underscore double underscore
  5. Emphasis in the middle of a word - T__his__ is an ex_am_ple
  6. Literal asterisk *literal asterisk*

Images/others

Image syntax has 2 styles:

  • Inline syntax, like

      ![Alt text](/path/to/img.jpg)
      ![Alt text](/path/to/img.jpg "Optional title") 
    

    This is an image for my workspace Octopress workspace

  • Preference style, using

      ![Alt text][id]
    

    Here id is the name of a defined image index, the same example: my ws


Reference:

  • Markdown syntax link
  • YAML Front matter link

Leave a Comment

Your email address will not be published. Required fields are marked *

Loading...