Introduction to markdown

Time:2020-1-14

1. title

#The number indicates the title.#h1) to######h6), a total of six levels of title, need to add a space after the well number.

Title 1
Title 2
Title 3
Title 4
#####Title 5
######Title 6

2. Paragraph and line break

  • There should be more than one blank line before and after the paragraph. Do not use spaces andtabCharacter indentation.
  • Or use two spaces and enter to generate<br />Label.

3. Block reference

  • Block references are converted to<blockquote>Label.
  • Add at the top of each line> ; or only the first line of the whole paragraph>
  • Block references can be nested as long as a different number of>
  • Other markdown syntax can also be used within the referenced block.

4. list

Unordered list

Use*Asterisk+Plus, or-The minus sign is used as a mark, and there must be at least one space between the mark and the text. Namely<ul>Label.

  • Asterisk: * asterisk
  • Plus sign: + plus sign
  • Minus: – minus

Ordered list

Use numbers and an English period. There should be at least one space between the mark and the text. Namely<ol>Label.

  1. Yes
  2. order
  3. column
  4. surface

To do list

  • [use]- [ ] To indicate unfinished business, there is a space between the short horizontal bar and the brackets, and there is a space between the brackets and after.
  • [x] use- [x] To indicate a done item, there is a space between the short horizontal bar and the brackets, and there is a space after the brackets.

5. code

Code block

Convert to<pre>and<code>Label.

Indent 4 spaces

<div>
  <p>This is a piece of code</p>
</div>

Or use three back Quotes“`The language of the code is enclosed and can be added after the three back quotes above.

console.log('js');

Inline code

If you want to mark a small piece of inline code, you can use backquotes ` Wrap up. such as< code > in line code < / code >

6. separation line

You can use more than three in a row* * *Asterisk---Minus sign,___Underline to create a separator. Nothing else in the line. You can also insert spaces between asterisks or minus signs. Namely<hr>Label.


7. emphasis

Use*Or underline_Mark it. There cannot be spaces between symbols and text.

  • Italics: text surrounded by a symbol is* Italic *Convert to<em>Label.
  • bold: surrounded by two symbols* * boldConvert to<strong>Label.

8. links

Inline

For link text[]Square brackets to mark. Square brackets followed by parentheses()Just insert the web address. If you want to addtitle, just leave a blank space after the URL and use double quotestitleJust wrap the text. Will be converted to<a>Label.

[markdown syntax] (http://www.markdown.cn/ "markdown tutorial")
<! -- equivalent to -- >
<p>
  < a href = "http://www.markdown.cn/" > markdown syntax</a>
</p>

Automatic link

use<>Angle brackets. The link text of the general website is the same as the link address.
<http://www.baidu.com>

picture

  • An exclamation point!
  • Then one.[]Square brackets with alternate text for pictures
  • Then one.()Ordinary brackets, which contain the URL of the picture, can also be enclosed in quotation marks and optionallytitleWritten words.
![Alt text](/path/to/img.jpg "Optional title")

Markdown has no way to specify the width and height of the image. If necessary, you can use the normal<img>Label.

Backslash

If you want to use some special symbols as ordinary symbols, you can add\Backslash.

form

ID name age
1 dora 18
|ID|name|age|
|:--|:-:|-:|
|1|dora|18|
  • |-:Extra spaces between will be ignored and will not affect the layout.
  • -:Indicates that the content and title block are aligned to the right,:-Indicates that the content and title block are aligned to the left,:-:Indicates that the content and title block are centered.
  • Content and|Extra space between lines is ignored, first in each line|And the last|can be omitted,-There must be at least one.