From scratch, teach you how to use Markdown

foreword

Today I will share how to use Markdown. Markdown is a lightweight markup language that allows us to write text in a way that is easy to read and write, and convert it to formats such as HTML. Below are some commonly used Markdown syntax. You can learn it in about ten minutes.

What is Markdown?

Markdown is a lightweight markup language that can quickly create formatted text with a simple syntax. It was created by John Gruber and Aaron Swartz in 2004 and is mainly used for writing blog posts, documents, e-books and other text formats.

Advantages of Markdown

Why do we use Markdown? It has the following advantages:

  • Easy to learn and use: Markdown syntax is very simple, it only takes a few minutes to learn, and it is also very convenient to edit.
  • Strong readability: Markdown syntax is very concise and easy to read, and it can also quickly convert text into HTML format.
  • Good compatibility: Markdown can be used in any text editor, and also supports all mainstream platforms.

The basic syntax of Markdown

Next, let's take a look at the basic syntax of Markdown:

1. Title

Headings are a structured representation of text content. In Markdown, you can use the # symbol to represent headings. The more the number of # symbols, the higher the level of the title, and up to six levels of titles are supported.

For example:

# 一级标题
## 二级标题
### 三级标题
#### 四级标题
##### 五级标题
###### 六级标题

The effect is as follows:
insert image description here

2. Paragraph

A paragraph is the basic unit of text and can be represented by adding blank lines before and after each paragraph of text.

For example:

这是第一个段落。
这是第二个段落。

The effect is as follows:
insert image description here

3. List

In Markdown, you can use *, +, or - to represent an unordered list, and use numbers plus . to represent an ordered list.

For example:

- 无序列表项 1
- 无序列表项 2
- 无序列表项 3

1. 有序列表项 1
2. 有序列表项 2
3. 有序列表项 3

The effect is as follows:
insert image description here

4. Emphasize

`In Markdown, you can use * or _ for emphasis.

For example:

*斜体*

The effect is as follows:

*italics*
You can also use ** or __ for bold.
For example:

**加粗**

The effect is as follows:
**bold**

5. Links

In Markdown, you can use [] and () to represent links.
For example:

[百度一下,你就知道](https://www.baidu.com/)

The effect is as follows:
insert image description here

6. Pictures

In Markdown, you can use to represent images.

For example:

![Markdown](https://markdown-here.com/img/icon256.png)

The effect is as follows:
Markdown

7. Citation

In Markdown, you can use the > symbol for references.

For example:

> 人生自古谁无死,
> 留取丹心照汗青。

The effect is as follows:
insert image description here

8. Code

In Markdown, you can use backticks (`) to indicate a single line of code, and triple backticks (```) to indicate multiple lines of code.

For example:

`print("Hello World!")`

The effect is as follows:
insert image description here

9. Form

In Markdown, you can use |symbols and -symbols to represent tables.
For example:

| 姓名 | 年龄 | 性别 |
| ---- | ---- | ---- |
| 张三 | 18   | 男   |
| 李四 | 20   | 女   |

The effect is as follows:
insert image description here

epilogue

Well, the above is the basic syntax of Markdown. Although the syntax of Markdown is very simple, it is very practical and can help us quickly create formatted text. I hope this article is helpful to you. If you have any other questions about Markdown, please leave a message in the comment area.

Guess you like

Origin blog.csdn.net/qq_33129875/article/details/129478054