Basic markdown syntax

Source: Internet
Author: User

This article briefly introduces the basic syntax of markdown, so that beginners can quickly get started and use this markup language.

Title

Title (H1 ~ H6You can use the corresponding number of # To generate. The following code will generate H3:

### this is a level-3 header ###

Or use the bottom line form, use = (the highest level title) and-(the second level title ):

This is an H1=============This is an H2-------------
Section and line feed

UseOne or more Empty rowSeparate content segments to generate paragraphs (<p>)
Input at the end of the row2 or more SpacePress enter to generate a line feed (<br>)

Emphasize

Quilt1* The text enclosed by _ will be surrounded by <em> labels:

*single asterisks*_single underscores_

Quilt2* The text enclosed by _ is surrounded by the <strong> label:

**double asterisks**__double underscores__

Note:If both sides of your * and _ are blank, they will only be treated as common symbols.

Separation line

UseMore than 3*-Or _ to establishSeparation line(<HR>), there cannot be any other content in the row:

* * *********- - ----------------------------------------
Block reference

Use> as the paragraph prefix to identify the referenced text paragraph. This is actuallyEmailTo mark the reference text:

> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.> > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse> id sem consectetuer libero luctus adipiscing.
List

Use * +-to represent the unordered list <ul>:

* Red* Green* Blue

UseNumberKeep up with oneEnglish sentence. To represent the ordered list OL:

1. Bird2. McHale3. Parish
Code

UseReverse quotation marks(') (Left of 1 on the keyboard) enclose the text to indicateIntra-row code, This text will be surrounded by <code> labels:

Use the `printf()` function.

UseFour SpaceOr1 Tab(Tab) indent to representCode blockThey will be wrapped by the <PRE> and <code> labels. & <and> In the code block will be automatically converted into HTML entities:

    <div class="footer">        &copy; 2004 Foo Corporation    </div>
Link

In-row Syntax:

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

Reference Syntax:

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

Note:The following link definition allows you to place it anywhere in the article.

Automatic link:

Implicit link mark:

I get 10 times more traffic from [Google][] than from[Yahoo][] or [MSN][].  [google]: http://google.com/        "Google"  [yahoo]:  http://search.yahoo.com/  "Yahoo Search"  [msn]:    http://search.msn.com/    "MSN Search"
Image

The syntax and link of the image are similar.InlineAndReference.
In-row Syntax:

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

Reference Syntax:

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

Note:So far, markdown has no way to specify the width and height of an image. If you need it, you can use a regular label.

Escape characters

You can use a backslash to insert symbols with other meanings in the Syntax:

\*literal asterisks\*

List of escape characters supported by markdown:

\ Backslash 'quotation marks * asterisks _ bottom line {} brackets [] square brackets () arc # Well font size + plus sign-minus sign. English sentence! Exclamation point
Others

Writing table:Markdown does not provide table syntax, but you can use tags to write tables like HTML. Note that the markdown expressions in HTML tags will not be parsed.
Code highlighting:This is not supported by markdown. The markdown editor of OSC supports code highlighting. You can use it above the Code <! -- LANG: Java --> or LANG: Java to specify the programming language. In this way, the article automatically uses syntaxhighlighter to color the syntax according to the specified language.

 

From: http://justcoding.iteye.com/blog/1954655

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.