Markdown: Basics (Quick Start)

Source: Internet
Author: User

Markdown: Basics (Quick Start)

Disclaimer: This document is derived from the Traditional Chinese version (fork). On this basis, the Traditional Chinese version is converted to the Simplified Chinese version, and the appropriate retouching is performed. This document is written in Markdown syntax. You can view its source files here. 「 Here are the original files in the Traditional Chinese version 」 -- By @ riku

Note: This project is hosted on GitCafe. Please use "" and "merge requests" to help improve this project.

Markdown: Basics (Quick Start)/(click to view the complete Syntax description) Getting the Gist of Markdown's Formatting Syntax

This page provides a simple Markdown concept. The syntax description page provides a complete and detailed document that describes each function. However, Markdown is actually easy to use. This document provides some examples, and each example provides output HTML results.

In fact, it is also a good method to try it directly. Dingus is a Web application. You can convert your own Markdown document into XHTML.

Section, title, Block Code

A paragraph is composed of more than one connected row sentence, and more than one blank row is divided into different paragraphs (the definition of blank rows is that it appears as a blank row, it is considered as a blank line. For example, if one line has only blank spaces and tabs, the line is also considered as a blank line. Generally, paragraphs do not need to be indented with blank spaces or line breaks.

Markdown supports the syntax of two headers: Setext and atx. The Setext form uses the bottom line form.=(The highest level title) and-(Second-level title). In the Atx format, insert one to six entries at the beginning of the row.#, Corresponding to level 1 to Level 6 of the title.

Block reference is in the form of email'>'Parentheses.

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 is a blockquote.> > This is the second paragraph in the blockquote.>> ## This is an H2 in a blockquote

The output HTML is:

Rhetoric and emphasis

Markdown uses asterisks and bottom lines to mark the segments to be emphasized.

Markdown Syntax:

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__.

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 two asterisks for <strong>strong emphasis</strong>.Or, if you prefer, <strong>use two underscores instead</strong>.</p>
List

The unordered list uses asterisks, plus signs, and minus signs as the project tags of the list. These symbols can be used with asterisks:

* Candy.* Gum.* Booze.

Plus sign:

+ Candy.+ Gum.+ Booze.

And Minus signs

- Candy.- Gum.- Booze.

The output HTML is:

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

An ordered list is marked with a general number followed by an English sentence:

1. Red2. Green3. Blue

The output HTML is:

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

If you insert a blank line between projects, the project content will use<p>Package, you can also put multiple paragraphs in a project, as long as there are four blank or one tab in front of it.

* A list item.    With multiple paragraphs.* Another item in the list.

The output HTML is:

<ul><li><p>A list item.</p><p>With multiple paragraphs.</p></li><li><p>Another item in the list.</p></li></ul>
Link

Markdown supports two forms of link Syntax:Intra-rowAndReferenceThe two forms use parentheses to convert words into links.

The line is directly followed by brackets to directly connect the link:

This is an [example link](http://example.com/).

The output HTML is:

<p>This is an <a href="http://example.com/">example link</a>.</p>

You can also add the title attribute selectively:

This is an [example link](http://example.com/ "With a Title").

The output HTML is:

<p>This is an <a href="http://example.com/" title="With a Title">example link</a>.</p>

The reference link allows you to specify a name for the link, and then you can define the content of the link elsewhere in the file:

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"

The output HTML is:

<p>I get 10 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>

The title attribute is optional. The Link name can contain letters, numbers, and spaces, but is case-insensitive:

I start my morning with a cup of coffee and[The New York Times][NY Times].[ny times]: http://www.nytimes.com/

The output HTML is:

<p>I start my morning with a cup of coffee and<a href="http://www.nytimes.com/">The New York Times</a>.</p>
Image

The syntax and link of the image are similar.

In-row format (title is optional ):

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

Reference format:

![alt text][id][id]: /path/to/img.jpg "Title"

The above two methods both output HTML:

Code

In common paragraph text, you can use reverse quotation marks`To mark code segments.&,<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 `&mdash;`instead of decimal-encoded entites like `&#8212;`.

The output HTML is:

<p>I strongly recommend against using any<code>&lt;blink&gt;</code> tags.</p><p>I wish SmartyPants used named entities like<code>&amp;mdash;</code> instead of decimal-encodedentites like <code>&amp;#8212;</code>.</p>

To create a formatted code block, you only need to indent each line with four spaces or a tab.&,<And>Also, the object is automatically converted to an HTML object.

Markdown Syntax:

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>

The output HTML is:

<p>If you want your page to validate under XHTML 1.0 Strict,you've got to put paragraph tags in your blockquotes:</p><pre><code>&lt;blockquote&gt;&lt;p&gt;For example.&lt;/p&gt;&lt;/blockquote&gt;</code></pre>

This article permanently updates the link address:

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.