Markdown is a text-only markup language. It can format ordinary text content with simple markup syntax.

Compared to the WYSIWYG editor

Advantages:

  1. Since it is pure text, the same editing effect can be obtained wherever Markdown is supported, allowing the author to get rid of the trouble of typesetting and concentrate on writing.
  2. Simple to operate. For example :WYSIWYG edit mark a title, first select the content, then click the title button in the navigation bar, select several levels of title. There are three steps. Markdown, on the other hand, simply adds a # to the header

Disadvantages:

  1. Need to remember some grammar (of course, it is easy. Five minutes).
  2. Some platforms do not support Markdown editing mode.

In-page jump

In-page jump is very practical. In the process of document description, it is often associated with other chapters in the page. In order to facilitate readers to read, it is necessary to add the function of page jump. In addition, the page jump, can also be used to manually create a directory.

The way to realize the page jump is also very simple, you can realize the jump to any label title, but it is also very pay attention to, otherwise there will be no jump. The markup format of the page jump is as follows:

[display](# title label - title text)Copy the code

Points to note:

  • [] Fill in the parentheses to be displayed on the page;
  • If the title number contains., and underscores are ignored directly. If there is a space in the title text, use – – to replace it.

Tip: For jump target headings in parentheses (), you can export Markdown to the HTML file and view the HTML source code using the id attribute value under the corresponding heading

tag. This will ensure that the jump is correct.

The title

Precede the text you want to set as a heading with # to indicate that one # is a primary heading, two # are secondary headings, and so on. Six levels of headings are supported.

Note: Standard syntax usually uses a # followed by a space.

Example:

# this is primary headlines # # # # # this is secondary this is triple title # # # # this is 4 # # # # # this title is a category five titles # # # # # # this is six levels of headingsCopy the code

The effect is as follows:

This is a level one title

This is a secondary heading

This is a level 3 headline

This is a level 4 title

This is a level five headline
This is a six-level headline

The font

Bold To bold text with two asterisks respectively wrapped

Use an asterisk (*) to wrap the left and right sides of the slanted text

Use three asterisks to wrap the left and right sides of the slanted and bold text

Delete line to add delete line text with two ~~ numbers respectively

Example:

This is bold words * * * * * this is tilted text * ` this is italicized bold words * * * * * * ~ ~ this is the text strikethrough ~ ~Copy the code

The effect is as follows:

This is the bold text, this is the slanted text, this is the italic bold text, this is the strikeout text

reference

Just add > before the quoted text. References can also be nested, such as adding two >> three >> N… It looks like we can keep adding, but there’s no eggs, right

Example:

> This is the content of the quote >> this is the content of the quote >>>>>>>>>> this is the content of the quoteCopy the code

The effect is as follows:

This is the quote

This is the quote

This is the quote

The divider

Three or more – or *.

Example:

-- -- -- - * * * * * * * *Copy the code

The effect is as follows:




As you can see, the display is the same.

The picture

Grammar:

! [image Alt](image address '' image title')Copy the code

Alt for an image is the text displayed below the image, which acts as an explanation of the image’s content. Picture title is the title of the picture and what is displayed when the mouse moves over the picture. Title can be added or not

! [blockchain](Ss0.bdstatic.com/70cFvHSh_Q1…

U =702257389,1274025419&fm=27&gp=0.jpg “blockchain”)

The effect is as follows:



The Markdown format pursues simple, multi-platform unification. Then the image storage is a problem, need to use the map bed, provide a unified external chain, so that there is no need to deal with the problem of pictures in different platforms. To write it once and use it everywhere.

hyperlinks

Grammar:

[Hyperlink name](hyperlink address "hyperlink title") Title can be added or notCopy the code

Example:

[Jane](http://jianshu.com) [Baidu](http://baidu.com)Copy the code

The effect is as follows:

Jane books baidu

Note: Markdown syntax does not support opening links in new pages. If you want to open links in new pages, you can use THE A tag of HTML language instead.

<a href=" _blank" href=" _blank">Copy the code

Sample book Jane

The list of

Unordered list syntax: Use – + * for any unordered list

- List contents + List contents * List contentsCopy the code

Note: there must be a space between – + * and the content

The effect is as follows:

  • List the content
  • List the content

Ordered list syntax: dot a number

1. Contents of the List 2. Contents of the List 3Copy the code

Note: There should be Spaces between the serial number and the content as follows:

  1. List the content
  2. List the content
  3. List the content

Type three Spaces between the upper and lower levels of the nested list

  • Level 1 unordered list content

    • Secondary unordered list content
    • Secondary unordered list content
  1. Level 1 ordered list content

    1.1 Contents of The Second-level Unordered List 1.2 Contents of the second-level Unordered List 1.3 Contents of the second-level unordered List

form

Grammar:

Header - | | | header header: - : | - : content of | | | | contents content contentCopy the code

The second line separates the header from the content.

  • There is a line, in order to align, added a few words on both sides of the left – add: by default said text center – the right to add: said words in the right Note: the native grammar with | wrapped up on both sides. Examples are omitted:
Name number | -- - | | skills: - : | - : liu2 bei4 | | cry eldest brother guan yu play | | second brother zhang fei scold | | three younger brotherCopy the code

The effect is as follows:

The name skills ranking
Liu bei cry The eldest brother
Guan yu play Second brother
Zhang fei scold Three younger brother

code

Syntax: Single line of code: Each code is enclosed in a single backquote

'Code content'Copy the code

Code block: Enclose the code in three backquotes, and the backquotes on each side are on a separate line

(` ` `) code... The code... The code... (` ` `)Copy the code

Note: in order to prevent translation, the three back quotes are enclosed in parentheses, which are not actually available. This is just for demonstration purposes, but in practice, you can remove the parentheses.

Example:

Single line of code

`create database hero; `Copy the code

The code block

Function fun(){echo "this is a very cool code "; } fun();Copy the code

The effect is as follows:

Single line of code

create database hero;

The code block

Function fun(){echo "this is a very cool code "; } fun();Copy the code

The flow chart

` ` ` mermaid flowchat st = > start: start the op = > operation: My operation cond = > condition: Yes or No? e=>end st->op->cond cond(yes)->e cond(no)->op &```Copy the code

The effect is as follows: