Rules for using markdown language in GitHub

Source: Internet
Author: User

Started using GitHub to touch the markdown, indeed as its purpose is "easy to read and easy to write", syntax concise and clear, more powerful than plain text, is a very suitable for the network of writing language. And one of the great advantages is that HTML is compatible, as long as it is not in the markdown coverage of the label, can be directly in the document with HTML writing.

Markdown is a ' writing ' format compared to HTML as a ' publish ' format.

Here is a detailed description of Markdown syntax:

Paragraph, title, block code

A paragraph is made up of more than one connected line sentence, and more than one empty line is divided into different paragraphs (the definition of a blank line is a blank line that looks like a blank line, such as a line with only blanks and tabs, which is considered a blank line), and the general paragraph does not need to be indented with white space or line breaks.

Markdown supports the syntax, Setext and ATX forms of both headings. The Setext form is in the form of a bottom line, using = (highest-order headings) and - (second-order headings), the Atx form inserts 1 to 6 at the beginning # , corresponding to the heading 1 to the 6-order.

Block references use the "angle brackets" in the form of email > .

Markdown Syntax:

A First level header====================a Second level Header---------------------Now is the time for all good men to come tothe aid of their country. This is just aregular paragraph. The quick brown fox jumped over the Lazydog's back.### Header 3> This was a blockquote.> > this is the second para Graph in the Blockquote.>> # # This was an H2 in a blockquote

The output HTML is:

  

Rhetoric and emphasis

Markdown uses asterisks and the bottom line to mark the segments that need to be highlighted.

Markdown Syntax:

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

The output HTML is:

<p>some of these words <em>are emphasized</em>. Some of these words <em>are emphasized also</em>.</p><p>use-asterisks for <strong> Strong emphasis</strong>. Or, if you prefer, <strong>use-underscores instead</strong>.</p>

  

List

Unordered lists use asterisks, plus and minus signs as item markers for the list, which are all available, using asterisks:

* candy.* gum.* booze.+ candy.+ gum.+ booze.-candy.-gum.-booze.

  The output HTML will be:

<ul><li>Candy.</li><li>Gum.</li><li>Booze.</li></ul>

An ordered list is marked with a normal number followed by a period as an item:

1. Red2. Green3. Blue

The output HTML is:

<ol><li>Red</li><li>Green</li><li>Blue</li></ol>

  

Link

Markdown supports two forms of link syntax: inline and reference, both of which use angle brackets to turn text into links.

The inline form is directly followed by a link in parentheses:

This was an [example link] (http://example.com/"with a Title"). Output HTML: <p>this is an <a href= "http://example.com/ "Title=" with a title ">example link</a>.</p>

A link to a reference form allows you to define a name for the link, and then you can have the content of the link defined elsewhere in the file:

I get ten 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" The output HTML is: <p>i get ten times more traffic from <a href= "http://google.com/" title= "Google" >Google</a> than from <a href= "http://search.yahoo.com/" title= "Yahoo search" >Yahoo</a> or <a href= "/http search.msn.com/"title=" MSN Search >MSN</a>.</p>

  

Image

The syntax and links of the picture are very similar.

In-line form (title is optional):

! [ALT text] (/path/to/img.jpg "Title")

  Reference form:

! [ALT text] [ID] [ID]:/path/to/img.jpg "Title"

  Both of the above methods will output:

  

Code

In general paragraph text, you can use the anti-quotation marks ` to mark the Code section, in the section & , < and > will be automatically converted to HTML entities, this feature allows you to easily insert HTML code in the Code section:

I strongly recommend against using any ' <blink> ' tags. I wish Smartypants used named entities like '-' instead of decimal-encoded entites like '-'. Output HTML: <p>i strongly REC Ommend against using any<code><blink></code> tags.</p><p>i wish SmartyPants used named Entities like<code>&mdash;</code> instead of decimal-encodedentites like <code>& #8212;< /code>.</p>

  If you want to create a block of code that is already well-formed, as long as each line is indented 4 spaces or a tab, and, as in the case, it & < > automatically turns into an HTML entity.

If you want your page to validate under XHTML 1.0 strict,you ' ve got to put paragraph tags in your blockquotes:<blockquo Te><p>for example.</p></blockquote> Output HTML: <p>if want your page to validate under XHTML 1.0 strict,you ' ve got to put paragraph tags in your blockquotes:</p><pre><code><blockquote>< P>for example.</p></blockquote></code></pre>

  

Rules for using markdown language in GitHub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.