What is Markdown?

推荐GitHub的makrdown教程

GitHub相关总教程
如果你能手动把这个教程拷到blog,那就是入门了

  • Headers

    1
    2
    3
    # This is an <h1> tag
    ## This is an <h2> tag
    ###### This is an <h6> tag
  • Emphasis

    1
    2
    3
    4
    5
    6
    7
    *This text will be italic*
    _This will also be italic_

    **This text will be bold**
    __This will also be bold__

    _You **can** combine them_
  • Lists

    • Unordered
      1
      2
      3
      4
      * Item 1
      * Item 2
      * Item 2a
      * Item 2b
  • Ordered

    1
    2
    3
    4
    5
    1. Item 1
    1. Item 2
    1. Item 3
    1. Item 3a
    1. Item 3b
  • Images

    1
    2
    ![GitHub Logo](/images/logo.png)
    Format: ![Alt Text](url)
  • Links

    1
    2
    http://github.com - automatic!
    [GitHub](http://github.com)
  • Blockquotes

    1
    2
    3
    4
    As Kanye West said:

    > We're living the future so
    > the present is our past.
  • Inline code

    1
    I think you should use an`<addr>` element here instead.
  • Syntax highlighting

Here’s an example of how you can use syntax highlighting with GitHub FlavoreMarkdown:

1
2
3
4
5
function fancyAlert(arg) {
if(arg) {
$.facebox({div:'#foo'})
}
}

You can also simply indent your code by four spaces:

    function fancyAlert(arg) {
      if(arg) {
        $.facebox({div:'#foo'})
      }
    }

Here’s an example of Python code without syntax highlighting:

1
2
3
def foo():
if not bar:
return True
  • Task Lists

    1
    2
    3
    4
    - [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
    - [x] list syntax required (any unordered or ordered list supported)
    - [x] this is a complete item
    - [ ] this is an incomplete item

    If you include a task list in the first comment of an Issue, you will get a handy progress indicator in your issue list. It also works in Pull Requests!

  • Tables
    You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe |:

    1
    2
    3
    4
    First Header | Second Header
    ------------ | -------------
    Content from cell 1 | Content from cell 2
    Content in the first column | Content in the second column

    Would become: (这表格太丑了)

First Header Second Header
Content from cell 1 Content from cell 2
Content in the first column Content in the second column
  • SHA references
    Any reference to a commit’s SHA-1 hash will be automatically converted into a link to that commit on GitHub.

    1
    2
    3
    16c999e8c71134401a78d4d46435517b2271d6ac
    mojombo@16c999e8c71134401a78d4d46435517b2271d6ac
    mojombo/github-flavored-markdown@16c999e8c71134401a78d4d46435517b2271d6ac
  • Issue references within a repository
    Any number that refers to an Issue or Pull Request will be automatically converted into a link.

    1
    2
    3
    #1
    mojombo#1
    mojombo/github-flavored-markdown#1
  • Username @mentions

    1
    Typing an @ symbol, followed by a username, will notify that person to come and view the comment. This is called an “@mention”, because you’re mentioning the individual. You can also @mention teams within an organization.
  • Automatic linking for URLs

    1
    Any URL (like http://www.github.com/) will be automatically converted into a clickable link.
  • Strikethrough

    1
    Any word wrapped with two tildes (like ~~this~~) will appear crossed out.