makedown常用语法

标题

markdown对于标题有两种语法:类 Setext 和类 atx 形式

类 Setext 形式是用底线的形式,利用 = (最高阶标题)和 - (第二阶标题)

1
2
3
4
5
Hello world
===========

Hello world
-----------

Hello world

Hello world

类 Atx 形式是在行首插入1 到6 个 #,随#的数量增加,标题级数减少

1
2
3
# Hello world

## Hello world

Hello world

Hello world

字体

Markdown 用星号(*)和底线(_)作为标记强调字词的符号,但前后符号必须统一

一个显示倾斜,两个显示加粗,三个星号加粗倾斜,两个波浪显示删除线,两个等号显示高亮

1
2
3
4
5
6
7
*Hello world*

**Hello world**

***Hello world***

~~Hello world~~
Hello world

Hello world

Hello world

Hello world

分割线

一行中用三个以上的星号、减号、底线来建立一个分隔线,在星号或是减号中间插入空格不影响使用。下面几写法

1
2
3
4
5
6
7
8
9
10
11
hello

-----------

hello

___________

hello

***
hello


hello


hello


引用

只需在引用的文字前加 > 建立一个区块,然后在每行的最前面加上 > (偷懒写法)简单的话整个段落的第一行最前面加上 > 即可。引用可以嵌套,只需根据层次,加入不同数量的>即可(这里hexo的makedown渲染有问题显示不了嵌套引用)

1
2
3
>According to the picture,we can see a pot containing a number of blocks.There are Chines characters on them,,such as [Kung fu],[Buddhism] and [Peking opera].In addition,the title below the picture is very eye-catching:cultural hotpot enriches our lives.On the one hand,this painting is very simple,with only a few strokes,but on the other hand,it evokes my deep thoughts on the subject behind it.

>>The idea this cartoon wishes to convey is very clear,mainly calling for us to attach more importance to the quality of opening our mind to different cultures.First of all,integrating other excellent cultures is the basis for our competitive advantage.Undoubtedly,if citizens in a nation cannot culivate this quality from an early age,this nation will be put in a very disadvantageous position when it comes to competing with others,and they are more likely to fail.Secondly,the progress of embracing foreign cultures outstanding parts is crucial for us to foster a positive mindest.No one candeny the fact that sticking to this goal can,to a large extern,motivate us to achieve excellence.

According to the picture,we can see a pot containing a number of blocks.There are Chines characters on them,,such as [Kung fu],[Buddhism] and [Peking opera].In addition,the title below the picture is very eye-catching:cultural hotpot enriches our lives.On the one hand,this painting is very simple,with only a few strokes,but on the other hand,it evokes my deep thoughts on the subject behind it. >The idea this cartoon wishes to convey is very clear,mainly calling for us to attach more importance to the quality of opening our mind to different cultures.First of all,integrating other excellent cultures is the basis for our competitive advantage.Undoubtedly,if citizens in a nation cannot culivate this quality from an early age,this nation will be put in a very disadvantageous position when it comes to competing with others,and they are more likely to fail.Secondly,the progress of embracing foreign cultures outstanding parts is crucial for us to foster a positive mindest.No one candeny the fact that sticking to this goal can,to a large extern,motivate us to achieve excellence.

表格

表格的第二行为了间隔表格和内容,同时起到创建表格的作用,而:号的作用就是调节内容的位置,如上图所示,不加默认居左,在两边加:文字居中,在右边加:文字居右

1
2
3
4
| 左对齐 | 右对齐 | 居中对齐 |
| :-----| ----: | :----: |
| 单元格 | 单元格 | 单元格 |
| 单元格 | 单元格 | 单元格 |
左对齐 右对齐 居中对齐
单元格 单元格 单元格
单元格 单元格 单元格

链接

超链接Markdown语法代码:超链接显示名,还有使用尖括号可以把URL或者email地址变成可点击的链接。

1
2
3
[百度](baidu.com)

<baidu.com>

百度

https://baidu.com


段落与换行

段落:要创建段落,请使用空白行将一行或多行文本进行分隔。

换行:在一行的末尾添加两个或多个空格,然后按回车键,即可创建一个换行 或者直接使用<br>换行


列表

Markdown的列表分别为有序列表和无序列表。 无序列表使用星号、加号或是减号作为列表标记,且同一列表的标记符号需相同。有序列表则使用数字接着一个英文句点作为标记。列表可以嵌套,级和级之间敲2个空格即可实现。


代码块

在Markdown中加入代码块有两种方式:代码块,代码区块

代码块:只要简单地缩进 4 个空格或是 1 个制表符就可以,第二种方法就是对于单行代码:代码之间分别用一个反引号包起来即可;

代码区块:代码之间分别用三个反引号包起来,可以在上面的 ``` 后面注明你的代码类型,可以产生相应的代码高亮效果


图片

使用感叹号 (!), 然后在方括号增加替代文本,图片链接放在圆括号里,括号里的链接后可以增加一个可选的图片标题文本。

1
![替代文本](./picture.png"图片标题")

makedown常用语法
https://retuze.github.io/sun/4bcd72f1.html
作者
Retuze
发布于
2023年9月21日
许可协议