MarkDown简单使用

作者: dreamkong | 来源:发表于2017-10-26 17:52 被阅读7次

    上面是原始文本,下面是对应Markdown效果,整理出来,方便查阅.

    A First Level Header
    ====================
    

    A First Level Header

    A Second Level Header
    ---------------------
    

    A Second Level Header

    ### Header 3
    

    Header 3

    > This is a blockquote.
    > 
    > This is the second paragraph in the blockquote.
    >
    > ## This is an H2 in a blockquote
    

    This is a blockquote.

    This is the second paragraph in the blockquote.

    This is an H2 in a blockquote

    Some of these words *are emphasized*.
    Some of these words _are emphasized also_.
    Use two asterisks for **strong emphasis**.
    Or, if you prefer, __use two underscores instead__.
    

    Some of these words are emphasized.
    Some of these words are emphasized also.
    Use two asterisks for strong emphasis.
    Or, if you prefer, use two underscores instead.

    + Candy.
    + Gum.
    + Booze.
    - Candy.
    - Gum.
    - Booze.
    * Candy.
    * Gum.
    * Booze.
    
    1. Red
    2. Green
    3. Blue
    
    * A list item.
            
        With multiple paragraphs.
    
    * Another item in the list.
    
    • Candy.
    • Gum.
    • Booze.
    • Candy.
    • Gum.
    • Booze.
    • Candy.
    • Gum.
    • Booze.
    1. Red
    2. Green
    3. Blue
    • A list item.

      With multiple paragraphs.

    • Another item in the list.

    This is an [example link](http://example.com/).
    
    This is an [example link](http://example.com/ "With a Title").
    
    I get 10 times more traffic from [Google][1] than from
    [Yahoo][2] or [MSN][3].
    
    [1]: http://google.com/ "Google"
    [2]: http://search.yahoo.com/ "Yahoo Search"
    [3]: http://search.msn.com/ "MSN Search"
    
    I start my morning with a cup of coffee and
    [The New York Times][NY Times].
    
    [ny times]: http://www.nytimes.com/
    

    This is an example link.

    This is an example link.

    I get 10 times more traffic from Google than from
    Yahoo or MSN.

    I start my morning with a cup of coffee and
    The New York Times.

    ![alt text](http://owz0zbwsq.bkt.clouddn.com/Failed%20building%20wheel%20for%20Twisted.png "Title")
    
    ![alt text][id]
    
    [id]: http://owz0zbwsq.bkt.clouddn.com/Failed%20building%20wheel%20for%20Twisted.png "Title"
    
    alt textalt text alt textalt text
    I strongly recommend against using any `<blink>` tags.
    
    I wish SmartyPants used named entities like `—`
    instead of decimal-encoded entites like `—`.
    

    I strongly recommend against using any <blink> tags.

    I wish SmartyPants used named entities like
    instead of decimal-encoded entites like .

    If you want your page to validate under XHTML 1.0 Strict,
    you've got to put paragraph tags in your blockquotes:
    
    <blockquote>
    <p>For example.</p>
    </blockquote>
    
    C#:
    
        //这里显示一些代码,在正文显示中会自动识别语言,进行代码染色,这是一段C#代码
        public class Blog
        {
             public int Id { get; set; }
             public string Subject { get; set; }
        }
    
    Python:
    
        keywords = ["dsaa","Asd","sadc","Gdfd","gdfdd","gaf","gabdddddd","eg"]
        print dict([(i[0],list(i[1])) for i in groupby(sorted(keywords),lambda    x:x[0].lower())])
    
    Javascript:
    
        /**
         * nth element in the fibonacci series.
         * @param n >= 0
         * @return the nth element, >= 0.
         */
        function fib(n) {
            var a = 1, b = 1;
            var tmp;
            while (--n >= 0) {
                tmp = a;
                a += b;
               b = tmp;
            }
            return a;
        }
    
        document.write(fib(10));
        
    

    If you want your page to validate under XHTML 1.0 Strict,
    you've got to put paragraph tags in your blockquotes:

    <blockquote>
    <p>For example.</p>
    </blockquote>

    C#:

    //这里显示一些代码,在正文显示中会自动识别语言,进行代码染色,这是一段C#代码
    public class Blog
    {
         public int Id { get; set; }
         public string Subject { get; set; }
    }
    

    Python:

    keywords = ["dsaa","Asd","sadc","Gdfd","gdfdd","gaf","gabdddddd","eg"]
    print dict([(i[0],list(i[1])) for i in groupby(sorted(keywords),lambda    x:x[0].lower())])
    

    Javascript:

    /**
     * nth element in the fibonacci series.
     * @param n >= 0
     * @return the nth element, >= 0.
     */
    function fib(n) {
        var a = 1, b = 1;
        var tmp;
        while (--n >= 0) {
            tmp = a;
            a += b;
           b = tmp;
        }
        return a;
    }
    
    document.write(fib(10));

    相关文章

      网友评论

        本文标题:MarkDown简单使用

        本文链接:https://www.haomeiwen.com/subject/kyceqxtx.html